Reputation: 13304
I'm trying to put the widget in the bottom and right position, with margin of 16dp, however I've tried it in a number of ways, with several layouts and it does not work. Can anybody help me?
ex35.py
from kivy.app import App
from kivy.core.window import Window
Window.clearcolor = (1, 1, 1, 1)
class Ex35(App):
pass
Ex35().run()
ex35.kv
FloatLayout:
BoxLayout:
orientation:'vertical'
Button:
text:'Hello'
Button:
text:'Hello'
Button:
text:'Hello'
Button:
text:'Hello'
Button:
text:'Hello'
Button:
text:'Hello'
Button:
text:'Hello'
Button:
text:'Hello'
Widget:
id: ellipse
size_hint: (None, None)
size: (dp(56), dp(56))
canvas:
Color:
rgba: 0, 1, 0, 1
Ellipse:
size: self.size
Upvotes: 0
Views: 1314
Reputation: 13304
I got it with the code below:
FloatLayout:
BoxLayout:
orientation:'vertical'
Button:
text:'Hello'
Button:
text:'Hello'
Button:
text:'Hello'
Button:
text:'Hello'
Button:
text:'Hello'
Button:
text:'Hello'
Button:
text:'Hello'
Button:
text:'Hello'
Widget:
id: ellipse
size_hint: (None, None)
size: (dp(56), dp(56))
pos_hint:{'right': 1}
canvas.before:
Color:
rgba: 0, 1, 0, 1
Ellipse:
size: self.size
pos: [dp(self.pos[0]) - dp(16), dp(self.pos[1]) + dp(16)]
Upvotes: 0