grantful 3 Posted July 27, 2023 I am working on an app that runs on ios and android. I can not set the tabcontrol tabHight to 70. If I set the tabcontrol1 tab hight to 70 and compile it there it goes back to 0. On form create i try to set it. TabControl1.TabHeight:= 70; I am trying to find something on Mobile Tutorial: Using Tab Components to Display Pages (iOS and Android) - RAD Studio (embarcadero.com) I think i am missing something on how it works. any help with this is greatly appreciated. Thanks Share this post Link to post
Dave Nottage 563 Posted July 27, 2023 14 minutes ago, grantful said: I think i am missing something on how it works Do you have AutoSize on the tab item set to False? Share this post Link to post
grantful 3 Posted July 27, 2023 Thanks Dave. I dont know how i missed that 🙂 Share this post Link to post
grantful 3 Posted July 28, 2023 I did go and uncheck the autosize on each tab item. I can see the change now in the ide but when i install on ios and android it still is small. Any thoughts ? Thanks for the help Share this post Link to post
Martifan 5 Posted July 30, 2023 On mobile platforms like iOS and Android, setting the TabHeight property directly on the TabControl doesn't work as expected. The tab height is determined automatically based on the platform and controls used. Instead, to increase the tab height you need to modify the TabControl's style. Here are a couple options to try: Set the TabControl's StyleLookup property to 'tabcontrolstyle' and modify that style in the Styles Designer. Increase the height of the tab elements in the style. Clone the default TabControl style, give it a new name like 'TabControlStyleBig', and modify the tab height there. Then set your TabControl.StyleLookup to that new style name. Set the TabControl's Style property directly in code instead of using StyleLookup. Modify the Tab tabOffset and Tab tabHeight style elements. For example: TabControl1.Style.StyleElements := [seTab, seClient]; TabControl1.Style.SetElementStyle(TabControl1.Style.GetElement(seTab), [], [tsTabHeight, 70]); The key is that the tab height can't just be directly set on mobile - you have to go through the control's style. Check the documentation on TTabControlStyles and styling for more details. 2 Share this post Link to post
grantful 3 Posted July 31, 2023 Thanks so much for the help i will try this. Share this post Link to post
sjordi 42 Posted August 1, 2023 On 7/30/2023 at 3:59 AM, Martifan said: On mobile platforms like iOS and Android, setting the TabHeight property directly on the TabControl doesn't work as expected. The tab height is determined automatically based on the platform [...] The key is that the tab height can't just be directly set on mobile - you have to go through the control's style. Check the documentation on TTabControlStyles and styling for more details. Thanks for the tip. I'll try to apply this to the font size. Under iOS, the font is so small in the tabs that it's barely readable when setting it to Platform Behavior. Share this post Link to post
Rollo62 539 Posted August 2, 2023 (edited) I usually don't rely on the TabControl UI for multi-plattform. The TabControl itself works fine, but I remove its visual Tabs and use separate navigation controls to switch between Tabs, for example simple TButton's in a separate TLayout. That way I have full control over behaviour and appearance and the UI and the navigation can even separated from the tab-control itself, or even easily replaced by different visual impressions for different device categories ( phone, tablet, desktop). Edited August 2, 2023 by Rollo62 1 Share this post Link to post
sjordi 42 Posted August 3, 2023 That's actually how I worked around the native TabControl since I was using only the tabs, not the panels as I use frames instead. I switched to 4 buttons in a horizontal grid layer at the bottom of the other layer containing a listbox. Was just curious if the font problem would be solved. I'll try it on a test blank app. 1 Share this post Link to post
Rollo62 539 Posted August 4, 2023 11 hours ago, sjordi said: That's actually how I worked around the native TabControl since I was using only the tabs, not the panels as I use frames instead. Same do I The advantage of frames is, that you can mimic any complex component even with many complex controls, and other frames, inside. Offering the ability to visually create and separately test them nice and easy, without the need to install them in the IDE on every change. The only drawback is, that you cannot drag-and-drop (although you could, but this RAD approach seems not reliable too me), but you have to use them at runtime instead. But for me this is a benefit, not a drawback 🙂 Share this post Link to post
sjordi 42 Posted August 18, 2023 It's also a huge improvement on ressource management. You load only the form/frame you need instead of 10 tabs when using only 1. Share this post Link to post