Android Question Inserting anchors in a layout in Tabstrips

Makumbi

Well-Known Member
Licensed User
Please help i have read difference literature about anchoring but it seems iam not getting it right please help me out how can i fix anchors in this example here please help
find attached example
i have also tried ERel example
 

Attachments

  • Backup KABOJJAAPP 2021-03-24 16.38.zip
    208.3 KB · Views: 111

Mahares

Expert
Licensed User
Longtime User
it seems iam not getting it right
I was looking at your project you posted yesterday and made some adjustments to the MainPage layout, Note I named it MainPage2.bal (attached) here so it does not overwrite your existing one. You can rename it. The views are a lot better distributed. This gets you started and you can even fine tune it better with additional designer scripts.
 

Attachments

  • mainpage2.bal
    5.4 KB · Views: 109
Upvote 0

Makumbi

Well-Known Member
Licensed User
I was looking at your project you posted yesterday and made some adjustments to the MainPage layout, Note I named it MainPage2.bal (attached) here so it does not overwrite your existing one. You can rename it. The views are a lot better distributed. This gets you started and you can even fine tune it better with additional designer scripts.

Thank you mahares for this change
i am also trying to use listview but my problem now is that this listview option opens only once then next term you close it and open it does not open
B4X:
Private Sub ParentProf_ItemClick (Position As Int, Value As Object)
    B4XPages.ShowPage("Helpus")
End Sub
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
this listview option opens only once then next term you close it and open it does not open
Instead of using the itemclick event of the listview, I added a button in Page1 layout and used it to open 'Helpus' page. It worked every time. I am not sure if you want to stick with listview or use a button or 2 buttons if you have 2 options.
B4X:
Private Sub b1_Click
    B4XPages.ShowPage("Helpus")
End Sub
 
Upvote 0

Makumbi

Well-Known Member
Licensed User
Instead of using the itemclick event of the listview, I added a button in Page1 layout and used it to open 'Helpus' page. It worked every time. I am not sure if you want to stick with listview or use a button or 2 buttons if you have 2 options.
B4X:
Private Sub b1_Click
    B4XPages.ShowPage("Helpus")
End Sub
i wanted to use the listview option. i was using the buttons as an example to see whether it opens well
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
i wanted to use the listview option
Instead of using Listview, I created a xCustomlistview and the item click event of the xClv fires every time. xClv is preferable to listview: Here is the process:
B4X:
'in Class globals of B4XMainPage
Private xClv As CustomListView  'need xcustomlistview lib. The xClv was added to Page1 layout. You can change color of xClv text
'In Sub B4XPage_Created I added these 2 items:
xClv.AddTextItem("Parent Profile","Parent Profile" )
xClv.AddTextItem("Change Number","Change Number" )
Then added this sub to B4XMainPage:
B4X:
Private Sub xClv_ItemClick (Index As Int, Value As Object)
    If Value="Parent Profile" Then
        B4XPages.ShowPage("Helpus")
    Else
        Log("do something else")
    End If
End Sub
It works every time and does not miss a beat.
 
Upvote 0

Makumbi

Well-Known Member
Licensed User
Instead of using Listview, I created a xCustomlistview and the item click event of the xClv fires every time. xClv is preferable to listview: Here is the process:
B4X:
'in Class globals of B4XMainPage
Private xClv As CustomListView  'need xcustomlistview lib. The xClv was added to Page1 layout. You can change color of xClv text
'In Sub B4XPage_Created I added these 2 items:
xClv.AddTextItem("Parent Profile","Parent Profile" )
xClv.AddTextItem("Change Number","Change Number" )
Then added this sub to B4XMainPage:
B4X:
Private Sub xClv_ItemClick (Index As Int, Value As Object)
    If Value="Parent Profile" Then
        B4XPages.ShowPage("Helpus")
    Else
        Log("do something else")
    End If
End Sub
It works every time and does not miss a beat.

thank you for this effort please provide me with that very attachment because when i try customlistview on long sentences like Send Multiple Classes To Your Email it chops off some words
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
provide me with that very attachment
Attached is a simple but full customlistview project that you can adapt to your own project. It use the xClv.AddTextItem .
It demonstrates that when you use xClv with the AddTextItem, each item panel height automatically expands to show all the text without truncation.
 

Attachments

  • ProjectMakumbi032621.zip
    19.3 KB · Views: 96
Upvote 0
Top