英文:
Rounding alternate edges in Kivy
问题
我看到其他解决方案中他们使用了上下的图像。
我觉得这对于制作交替的圆角非常复杂。
就像下面这个例子一样:
英文:
I did saw other solutions where they use up and down images.
Which I found very complex for making alternate rounded edges.
Like this one below:
答案1
得分: 2
我定义了一个名为SmoothButton的按钮,我在所有我的组件中都使用它:
<SmoothButton@Button>:
background_color: (0, 0, 0, 0)
background_normal: ''
back_color: (0.565, 0.557, 0.698, 0.8)
border_radius: [0, 35, 0, 35]
font_name: 'Comic'
canvas.before:
Color:
rgba: self.back_color
RoundedRectangle:
size: self.size
pos: self.pos
radius: self.border_radius
请注意这里唯一的注意事项是:
border_radius: [0, 35, 0, 35]
英文:
I defined a smoothbutton which I used as Button in all my components:
<SmoothButton@Button>:
background_color:(0,0,0,0)
background_normal:''
back_color: (0.565, 0.557, 0.698,0.8)
border_radius:[0,35,0,35]
font_name:'Comic'
canvas.before:
Color:
rgba:self.back_color
RoundedRectangle:
size:self.size
pos:self.pos
radius:self.border_radius
Note the only catch here is :
border_radius:[0,35,0,35]
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论