I recently got into a problem with corwin42's AHActionBar library. The title is not showing up in portrait mode, but it's showing in landscape, although on the wrong place.
Portrait mode:
Landscape mode:
Code:
B4X:
'ACTIONBAR
AB.Initialize("AB") 'Initializes the actionbar.
AB.Background = ABBackground 'Sets the background of the actionbar.
AB.ActionWidth = 42dip 'You can change the width of an action item. 42dip is default.
AB.AddHomeAction(ID_ACTION_HOME,ABHome) 'Adds the home button to the actionbar.
AB.AddAction(ID_ACTION_MENU,ABMenu) 'Adds an action button to the actionbar.
Activity.AddView(AB, 0, 0, 100%x, 42dip) 'Adds the actionbar to the activity.
72x72 is fine. You even set the ActionWidth properly. I expect it to work fine!
If you could upload your project (or barebones) that would be helpful, I cannot think of anything else (you can check SetActionPadding maybe)
72x72 is fine. You even set the ActionWidth properly. I expect it to work fine!
If you could upload your project (or barebones) that would be helpful, I cannot think of anything else (you can check SetActionPadding maybe)
Can you explain me what it does? Also perhaps if I try 48x48, like the ic_menu_home.png file in my Android folder on my pc, would it work then?
Edit:
Wow, that was so stupid, the problem was in the background, if you see good at landscape mode, the background starts a second time, there is the title displayed.
When I removed
B4X:
AB.background = ABBackground
and changed it to
B4X:
AB.Initialize2("AB",ABBackground)
it worked perfect and the title is now showing correctly. Very weird, but yes, it works now.
I see.
That is good information for me too.
I remember setting the background, sets it on all buttons/titles etc individally.
So Initialize2 is different from settings background, I did not know that.
Good that it is working for you.