Tabhost Layout 100%x not correctly

Paulsche

Well-Known Member
Licensed User
Longtime User
i have a Tabhost and insert in a Layout in Designer a Scrollview
with code
B4X:
AutoScaleAll

SCV02KategorieListe.SetLeftAndRight(0,100%x)
SCV02KategorieListe.SetTopAndBottom(10dip,80%y)

In IDE Code
B4X:
Activity.AddView(TabHost1,0,0,100%x,100%y)

The Right Position of Scrollview is not equal the Right of Tabhost.

Whats Wrong ?
 

Attachments

  • scroll.jpg
    scroll.jpg
    13.1 KB · Views: 176

doncx

Active Member
Licensed User
Longtime User
Just posted a similar problem

Mine was the opposite, though.

My layouts loaded into the TabHost are clipped on the right.

If you learn anything, please let me know. I'll do that same.

Thanks

- Doncx
 
Upvote 0

doncx

Active Member
Licensed User
Longtime User
More information from doncx

Erel, thanks for your reply. Paulsche, my apologies for jumping in. Perhaps this helps us both.

I've uploaded images of my issue. Please find the following:

- Image of tabhost in designer (320x480,scale=1)
- Image of tab contents (sample layout) in designer (320x480,scale=1)
- Image of emulator with tabhost and sample within a tab (320x480)
- Image of emulator with sample layout outside of tabhost (320x480)

The code is ultimately simple:
B4X:
Activity.LoadLayout("sampling_tabs")
tbh_sampling.AddTab("Sample Data", "sample") 
tbh_sampling.AddTab("Notes and Photo", "sample_notes")

All designer scripts declare:
B4X:
AutoScaleRate(1)
AutoScaleAll

Putting the sample layout in a tab actually expands it!

I'm hoping there's a predictable way to make it fit as scaled in the designer.
 

Attachments

  • tabhost_designer.jpg
    tabhost_designer.jpg
    9.9 KB · Views: 187
  • sample_designer.jpg
    sample_designer.jpg
    17.4 KB · Views: 174
  • within_tabhost.jpg
    within_tabhost.jpg
    19.1 KB · Views: 158
  • outside_tabhost.jpg
    outside_tabhost.jpg
    18.5 KB · Views: 150
Last edited:
Upvote 0

Paulsche

Well-Known Member
Licensed User
Longtime User
I define the ScrollView now in the ide as the TabHost, it fits again. TabHost in the designer does not define, because the tabs do not agree then correctly.
 
Upvote 0
Top