The ActionBar
widget is like the popular Android's ActionBar
. Here the children are stacked in horizontal and vertical groups such as menus. This recipe will use the ActionBar
widget to organize eight buttons, and the bar will be the superior part of the app that has two buttons.
In this recipe, we need an icon such as the commonly used save icon. For this purpose, we will use the image floppy.png
, which looks like:
Here, we will use a KV file to set and organize ActionBar
and its children and the Python file to add ActionBar
to our app. To complete the task, perform the following steps:
In the KV file, define the rule
<MyW>
.In this rule, add the
ActionBar
widget.In the
ActionBar
child, add a button with thefloppy.png
icon.Add three more buttons.
Add three child buttons to
ActionGroup
.Define another rule
<MyW>
with two buttons using the following code:<MyW>: ActionBar: pos_hint: {'top':1} ActionView: ...