Here you go:BoxLayout:
orientation: 'vertical'
BoxLayout:
size_hint_y: .2
orientation: 'horizontal'
spacing: 10 # to show the background color
canvas:
Color:
rgb: (.5, .5, .5)
Rectangle:
pos: self.pos
size: self.size
Button:
id: button_1
text:'Push me'
Button:
text:'Test'
Button:
text: 'Action'
Label:
text:'Blank'

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/99ebd8ca-c093-416d-ba80-b38026d954ca%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.
Just to be clear, you want to replace the buttons in the example below with Spinners?
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/797aae48-0b49-4e95-a23f-5b3a8de03012%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/5dca3ec4.1c69fb81.4ad01.7697SMTPIN_ADDED_MISSING%40gmr-mx.google.com.
The KV code below will behave more like a traditional menu, where the menu title item is what is always shown. Another alternative is to look at the Actionbar widget: https://kivy.org/doc/stable/api-kivy.uix.actionbar.html
BoxLayout:
orientation: 'vertical'
BoxLayout:
size_hint_y: .2
orientation: 'horizontal'
spacing: 10 # to show the background color
canvas:
Color:
rgb: (.5, .5, .5)
Rectangle:
pos: self.pos
size: self.
size
Spinner:
text: 'File'
values: ['open', 'close']
on_text:
# do action and then return to original value?
self.text = 'File'
Spinner:
text:'Edit'
values: ['1','2', '3']
on_text:
# do action and then return to original value?
self.text = 'Edit'
Spinner:
text: 'View'
values: ['A', 'B', 'C']
on_text:
# do action and then return to original value?
self.text = 'View'
Spinner:
text: 'Help'
values: ['OMG', 'WTF', 'ROFLMAO']
on_text:
# do action and then return to original value?
self.text = 'Help'
Label:
text:'Blank'
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/CACYZbMUO4Yp2aNfegB-5OOJBisr%2BpeYCZj%3DtT5ysbyeOzPX8sw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/5dca4319.1c69fb81.60f74.88e8SMTPIN_ADDED_MISSING%40gmr-mx.google.com.
from kivy.app import App
from kivy.lang.builder import Builder
kv = '''
#: set white [1, 1, 1, 1]
#: set black [1, 1, 1, 1]
<ImageButton@ButtonBehavior+Image>: # multiple inheritance in kivy, defines new class
size_hint_y: None
height: '64dp'
BoxLayout:
orientation: 'vertical'
BoxLayout:
orientation: 'vertical'
size_hint_y: .1
Button:
id: btn
text: 'DropDown'
on_release: dropdown.open(self)
size_hint_y: None
background_normal: '' # remove normal button image, or replace with an alternative
background_color: white
color: 0,0,0,1
height: '48dp'
Widget:
on_parent: dropdown.dismiss()
DropDown:
id: dropdown
on_select: btn.text = f'Selected value: {args[1]}'
Button:
text: 'Value A'
size_hint_y: None
height: '48dp'
background_normal: ''
background_color: white
color: 0,0,0,1
on_release: dropdown.select('A')
Button:
text: 'Value B'
size_hint_y: None
height: '48dp'
background_normal: ''
background_color: white
color: 0,0,0,1
on_release: dropdown.select('B')
Button:
text: 'Value C'
size_hint_y: None
height: '48dp'
background_normal: ''
background_color: white
color: 0,0,0,1
on_release: dropdown.select('C')
ImageButton:
source: 'Actions-media-playback-start-icon.png' # Your image here
on_release: dropdown.select('Play Button')
Label:
text:'Blank'
'''
class DDTestApp(App):
def build(self):
return Builder.load_string(kv)
if __name__ == '__main__':
DDTestApp().run()
Got it. thanks
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/797aae48-0b49-4e95-a23f-5b3a8de03012%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/5dca3ec4.1c69fb81.4ad01.7697SMTPIN_ADDED_MISSING%40gmr-mx.google.com.
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/CACYZbMUO4Yp2aNfegB-5OOJBisr%2BpeYCZj%3DtT5ysbyeOzPX8sw%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/5dca4319.1c69fb81.60f74.88e8SMTPIN_ADDED_MISSING%40gmr-mx.google.com.
FloatLayout:
canvas:
Color:
rgb: (1, 1, 1)
Rectangle:
pos: self.pos
size: self.size
Color:
rgba: 0,0,0,1
Line:
width:root.height*.001
cap: 'none'
points : 0,.95*root.height,root.width,.95*root.height
Button:
id: panel1
text: 'File'
pos_hint: {"x": 0 , "y":0.95}
size_hint: 0.1, 0.05
on_release: dropdown1.open(self)
background_normal: '' # remove normal button image, or replace with an alternative
background_color:1,1,1,1
color: 0,0,0,1
Widget:
on_parent: dropdown1.dismiss()
DropDown:
id: dropdown1
on_select: panel1.text = f'Selected value: {args[1]}'
Button:
text: 'Value A'
background_normal: ''
background_color: 1,1,1,1
color: 0,0,0,1
size_hint: 0.1, 0.05
pos_hint: {"x": 0 , "y":0.9}
on_release: dropdown1.select('A')
Button:
text: 'Value B'
background_normal: ''
background_color: 1,1,1,1
color: 0,0,0,1
size_hint: 0.1, 0.05
on_release: dropdown1.select('B')
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/7f278436-96a9-444a-a7f8-5e8ec3b89d33%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+unsubscribe@googlegroups.com.
On Nov 12, 2019, at 11:13 PM, elec part <pele...@gmail.com> wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/56fc4434-a319-4530-8223-26d51dc23867%40googlegroups.com.
What is the effect you are looking to achieve?
Why a FloatLayout? I typically only use a FloatLayout for special cases where I need to position on object on top of another.
From: Elliot Garbus
Sent: Wednesday, November 13, 2019 9:52 AM
To: kivy-...@googlegroups.com
Subject: Re: [kivy-users] Change the background color in Spinner
Try putting everything below the canvas in a BoxLayout.
Sent from my iPhone
On Nov 12, 2019, at 11:13 PM, elec part <pele...@gmail.com> wrote:
I forgot height: 44 instead of Pos_hint and Size_hint. Sorry about that
On Wednesday, 13 November 2019 09:33:12 UTC+3:30, elec part wrote:
This is picture of my app
to this
Thank you so much
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/7f278436-96a9-444a-a7f8-5e8ec3b89d33%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/56fc4434-a319-4530-8223-26d51dc23867%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/6C48AD16-E302-44BF-AEEB-0F23F149D2E5%40cox.net.
See the code below. The MyDropDown is a BoxLayout, but I put in under a FloatLayout to position the dropdown on the screen.
from kivy.app import App
from kivy.lang.builder import Builder
kv =
'''
#: set white [1, 1, 1, 1]
#: set black [1, 1, 1, 1]
<ImageButton@ButtonBehavior+Image>: # multiple inheritance in kivy, defines new class
size_hint_y: None
height: '64dp'
<DDTextButton@Button>:
size_hint_y: None
height: '48dp'
background_normal: ''
background_color: white
color: 0,0,0,1
<MyDropDown@BoxLayout>:
orientation: 'vertical'
size_hint_y: .1
Button:
id: btn
text: 'DropDown'
on_release: dropdown.open(self)
size_hint: None, None
background_normal: '' # remove normal button image, or replace with an alternative
background_color: white
color: 0,0,0,1
height: '48dp'
Widget:
on_parent: dropdown.dismiss()
DropDown:
id: dropdown
on_select: btn.text = f'Selected value: {args[1]}'
DDTextButton:
text: 'Value A'
on_release: dropdown.select('A')
DDTextButton:
text: 'Value B'
on_release: dropdown.select('B')
DDTextButton:
text: 'Value C'
on_release: dropdown.select('C')
ImageButton:
source: 'Actions-media-playback-start-icon.png' # Your image here
on_release: dropdown.select('Play Button')
BoxLayout:
orientation: 'vertical'
canvas:
Color:
rgb: (1, 1, 1)
Rectangle:
pos: self.pos
size: self.size
Color:
rgba: 0,0,0,1
Line:
width: root.height*.001
cap: 'none'
points : 0,.9 * root.height, root.width, .9 * root.height
FloatLayout:
MyDropDown:
pos_hint: {'x': .8, 'y': .9}
MyDropDown:
pos: 200,200
MyDropDown:
pos_hint: {'x': .4, 'y': .9}
'''
class DDTestApp(App):
def build(self):
return Builder.load_string(kv)
if __name__ == '__main__':
DDTestApp().run()
From: Electronic Part
Sent: Monday, November 25, 2019 11:18 PM
To: Kivy users support
Subject: Re: [kivy-users] Change the background color in Spinner
Coould you please help me to make dropdown list by using FloatLayout? As you said, I want to put drop down in a specefic position. Thank you so much for your help
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/87ea6def-9998-409f-baec-b32c3bdb4289%40googlegroups.com.
FloatLayout:
pos_hint: {"x": 0 , "y":0.9}
size_hint: 1, 0.05
dropdown1: dropdown1.__self__
#orientation: 'vertical'
#size_hint_y: .1
Button:
pos_hint: {"x": 0 , "y":1}
size_hint: .1, 0.05
id: panel1
text: 'File'
on_release: dropdown1.open(self)
size_hint_y: None
#background_normal: '' # remove normal button image, or replace with an alternative
background_color: 1,1,1,1
color: 0,0,0,1
height: '48dp'
Widget:
on_parent: dropdown1.dismiss()
DropDown:
id: dropdown1
on_select: panel1.text = f'Selected value: {args[1]}'
Button:
text: 'Exit'
size_hint_y: None
height: '48dp'
background_normal: ''
background_color: 1,1,1,1
color: 0,0,0,1
#on_release: dropdown1.select('A')
on_press: app.stop()
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/5ddd1efd.1c69fb81.befb4.6fc3SMTPIN_ADDED_MISSING%40gmr-mx.google.com.