Android Question How to use Designer Scripts with PanelList/TabHost

AHilberink

Active Member
Licensed User
Longtime User
Hi,
I do have a PanelList loaded by a TabHost.
Now I want to have a scalable display, so I use Designer Scripts.
It seems the content of the PanelList depends on the TabHost, so I cannot use 100%x or 100%y. I cannot use PanelList.Right or TabHost.Right either because these are on a different display.
Is there a way to calculate this correctly?
I hope I explained it well and someone can help.
Best Regards,
André
 

AHilberink

Active Member
Licensed User
Longtime User
There is no problem with loading layouts to tab pages. Usually you will use different layout files for different tabs (though you can use the same file).

I changed it back, but I can get only one tab working using the same layout file. But this function is not my problem.

To see my problem:
Run the app. Go to the end of the ListView1 table. As you can see it is Titel 35. Press the Search button on the header. Now you see Titel 34 and Titel 35 is out of the screen and you are not able to reach it. Pressing the Search button again and it will be correct.

This happens because the ListView1.Top is set from 0 to 51, but the ListView1.Height is still the same. How can I calculate the correct Heigth is the question.

Best regards,
André
 

Attachments

  • ProjectNew.zip
    51.6 KB · Views: 239
Upvote 0

klaus

Expert
Licensed User
Longtime User
At line 132 replace this line
Activity.AddView(tbhTest, 0, 0, 100%x-btnSearch.Width, 50%y)
by this one:
scvTest.Panel.AddView(tbhTest, 0, 0, 100%x-btnSearch.Width, 50%y)

Best regards.

EDIT: Replyed in the wrong thread.
 
Last edited:
Upvote 0

AHilberink

Active Member
Licensed User
Longtime User
At line 132 replace this line
Activity.AddView(tbhTest, 0, 0, 100%x-btnSearch.Width, 50%y)
by this one:
scvTest.Panel.AddView(tbhTest, 0, 0, 100%x-btnSearch.Width, 50%y)

Best regards.

Hi Klaus,

Thank you for your answer, but I cannot find the line or command you mentioned in my project.

Best regards,
André
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Sorry, I replied in the wrong thread. Please forget my post #23.

Attached you find your modified project.
The problem in your code is that you set ListView1.Height = -1 to fill the TabHost.
But when you set ListView1.Top = 51dip you don't change the TabHost1.Height so the height ListView1 is refering to remains the same !

Best regards.
 

Attachments

  • ProjectNew_1.zip
    51.4 KB · Views: 249
Upvote 0

AHilberink

Active Member
Licensed User
Longtime User
Sorry, I replied in the wrong thread. Please forget my post #23.

Attached you find your modified project.
The problem in your code is that you set ListView1.Height = -1 to fill the TabHost.
But when you set ListView1.Top = 51dip you don't change the TabHost1.Height so the height ListView1 is refering to remains the same !

Best regards.

Hi Klaus,

Thank you very much for your solution. It works fine. I expected the problem was the ListView1.Height, but I didn't find a way to get the right value. As I see in your solution, it seems I had to use an additional library to calculatie the original Height from the start.

Thanks again.

Best regards,
André
 
Upvote 0
Top