Width reduced in TableHost

ciginfo

Well-Known Member
Licensed User
Longtime User
Hello
Why when I use "TableHost" an object with 100% of x in a layout exceeds the right edge. I am forced to program in the layout an object with 95% of x for full view when TableHost is used.
thank you
 

Attachments

  • Av1.png
    Av1.png
    38.6 KB · Views: 244
  • Av2.png
    Av2.png
    84.7 KB · Views: 243

ciginfo

Well-Known Member
Licensed User
Longtime User
The object is on a layout made ​​with the designer and called by the TableHost. It is not in the TableHost directly.
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
1. I think Erel wants to know which object (Panel?, Label?, Listview?,etc. ) that exceeds the 100%x and where in your code you refer to it? You need to provide more details concerning the problem (un peu plus de details).
2. I, for one could not run your project because it is missing the 4 png files in this below code:
B4X:
bmp1_enreg = LoadBitmap(File.DirAssets, "enreg_01.png")
bmp2_enreg = LoadBitmap(File.DirAssets, "enreg_02.png")
bmp1_review  = LoadBitmap(File.DirAssets, "review_01.png")
bmp2_review  = LoadBitmap(File.DirAssets, "review_02.png")
3. C'est TABHOST, non pas TABLEHOST.
 
Upvote 0

ciginfo

Well-Known Member
Licensed User
Longtime User
OK
All objects (panels, labels, buttons etc ) exceed 100% x.
Every object built with designer and touches the right border of the layout exceeds the layout when it is called with tabhost.

Ok for tabehost
 
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
I had the same problem, was some time ago i worked on this particular project though. Think I gave a 20dip padding around, i.e. set the tabhost.left to -20dip and the width to (100%x + 40dip)
 
Upvote 0

ciginfo

Well-Known Member
Licensed User
Longtime User
In fact, attached a small program that shows my problem. the first image shows the layout when the designer is connected to the virtual device, the second image shows the layout called by tabhost after program launched.
Designer layout : Widht 480, Height 800, Scale 1.5 (for galaxy S2).
 

Attachments

  • tabhost1.png
    tabhost1.png
    18.1 KB · Views: 196
  • tabhost2.png
    tabhost2.png
    21.7 KB · Views: 192
  • essai_tabhost.zip
    8.7 KB · Views: 210
Upvote 0

ciginfo

Well-Known Member
Licensed User
Longtime User
There is no code to set the width of the objects. The width of the objects is in the designer (files.bal). It's not the good way?
 
Upvote 0

ciginfo

Well-Known Member
Licensed User
Longtime User
Yes, but when I place with the designer an object against the right edge of the layout, object is not fully seen when the layout is called with the tabhost.
Why? What i have to do?
 

Attachments

  • designer.png
    designer.png
    11.1 KB · Views: 198
  • designer0.png
    designer0.png
    8.5 KB · Views: 190
  • designer2.png
    designer2.png
    29.3 KB · Views: 196
Upvote 0

Informatix

Expert
Licensed User
Longtime User
Yes, but when I place with the designer an object against the right edge of the layout, object is not fully seen when the layout is called with the tabhost.
Why? What i have to do?

Nothing strange here. You can see that your label does not start against the left edge, then how could you expect it to be correctly sized if you set its width to the maximum screen width ? It is obvious that the TabHost has an internal padding. You must take it into account and remove the padding width from the label width.
There's an easy solution if you don't want to do computations: set the label width to -1 (FILL_PARENT).
 
Upvote 0
Top