iOS Question BarButton click event

mcorbeel

Active Member
Licensed User
Longtime User
I am making mt first iOS app and all is going well. However there is one thing that I do not find.
I need to have a menu button at the top of a page that when clicked shows a menu. I use this code to create the top right button:

Dim btn As BarButton
btn.InitializeBitmap(LoadBitmap(File.DirAssets, "menu.png"), "Button_Menu")

Dim btnList As List
btnList.Initialize
btnList.Set(0, btn)
MyPage.TopRightButtons = btnList

The icon is showing, but I was hoping to find the click event of that button under Button_Menu_Click but that does not work.
How can I use the click event?
 

mcorbeel

Active Member
Licensed User
Longtime User
Sorry, forgot:

B4X:
Dim btn As BarButton
btn.InitializeBitmap(LoadBitmap(File.DirAssets, "menu.png"), "Button_Menu")

Dim btnList As List 
btnList.Initialize
btnList.Set(0, btn)
MyPage.TopRightButtons = btnList
 
Upvote 0

mcorbeel

Active Member
Licensed User
Longtime User
Thank you Erel, the event with the page name works.
I prefer making my layout by code... don't know why... a (bad?) habit.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
a (bad?) habit
In most cases yes. It will be much simpler to build a layout that properly adapts to the page size with the visual designer.

There are two relevant videos that all B4i developers should watch:
- Visual Designer
- B4i / B4J - Resize event

https://www.b4x.com/etp.html
 
Upvote 0

Similar Threads

Top