ciginfo Well-Known Member Licensed User Longtime User Aug 12, 2012 #1 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 38.6 KB · Views: 497 Av2.png 84.7 KB · Views: 463
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
Erel B4X founder Staff member Licensed User Longtime User Aug 13, 2012 #2 Where is this object? Inside the TabHost? Upvote 0
ciginfo Well-Known Member Licensed User Longtime User Aug 13, 2012 #3 The object is on a layout made with the designer and called by the TableHost. It is not in the TableHost directly. Upvote 0
The object is on a layout made with the designer and called by the TableHost. It is not in the TableHost directly.
Erel B4X founder Staff member Licensed User Longtime User Aug 13, 2012 #4 Can you upload your layout file? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Aug 13, 2012 #6 Where is the relevant code (which line / sub)? Upvote 0
ciginfo Well-Known Member Licensed User Longtime User Aug 13, 2012 #7 I don t understand. What is relevant code (which line / sub) Upvote 0
M Mahares Expert Licensed User Longtime User Aug 13, 2012 #8 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: Code: 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
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: Code: 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.
ciginfo Well-Known Member Licensed User Longtime User Aug 13, 2012 #9 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
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
barx Well-Known Member Licensed User Longtime User Aug 13, 2012 #11 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
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)
ciginfo Well-Known Member Licensed User Longtime User Aug 14, 2012 #12 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 18.1 KB · Views: 380 tabhost2.png 21.7 KB · Views: 499 essai_tabhost.zip essai_tabhost.zip 8.7 KB · Views: 372 Upvote 0
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).
Erel B4X founder Staff member Licensed User Longtime User Aug 15, 2012 #13 Where is the code that set the width? I don't see any designer script. Upvote 0
ciginfo Well-Known Member Licensed User Longtime User Aug 15, 2012 #14 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
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?
Erel B4X founder Staff member Licensed User Longtime User Aug 16, 2012 #15 You can only specify percentage units in the designer scripts or code. Upvote 0
ciginfo Well-Known Member Licensed User Longtime User Aug 18, 2012 #16 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 11.1 KB · Views: 450 designer0.png 8.5 KB · Views: 481 designer2.png 29.3 KB · Views: 408 Upvote 0
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?
Informatix Expert Licensed User Longtime User Aug 18, 2012 #17 ciginfo said: 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? Click to expand... 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
ciginfo said: 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? Click to expand... 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).
Erel B4X founder Staff member Licensed User Longtime User Aug 18, 2012 #18 It is actually quite simple. You should add this line to the designer script: Code: Label2.SetLeftAndRight(0, 100%x) Upvote 0
It is actually quite simple. You should add this line to the designer script: Code: Label2.SetLeftAndRight(0, 100%x)
Informatix Expert Licensed User Longtime User Aug 18, 2012 #19 Erel said: It is actually quite simple. You should add this line to the designer script: Code: Label2.SetLeftAndRight(0, 100%x) Click to expand... I will be surprised if that solves the problem... Upvote 0
Erel said: It is actually quite simple. You should add this line to the designer script: Code: Label2.SetLeftAndRight(0, 100%x) Click to expand... I will be surprised if that solves the problem...