Android Question xCustomListView - Invalid layout size

Tadeu Botelho

Member
Licensed User
Longtime User
Hello friends
I have a problem trying to read the full height of the full screen views. Because I want to open the layout within an xCustomListView.
Could someone help me with this?
The code is attached.
B4X:
Sub Activity_Create(FirstTime As Boolean)
 
    If FirstTime=True Then
 
    Activity.LoadLayout("layout_configuracoes_clv")
        Dim fraContainer As Panel
        fraContainer.Initialize("")
      
        'It should work by returning the full size for framing on the screen. But always returns less.
        fraContainer.SetLayout(0, 0, CLV.AsView.Width, CLV.AsView.Height)
    
        'Tests done to manually stretch the height (This should be done automatically for some property I didn't find)
        'fraContainer.SetLayout(0, 0, CLV.AsView.Width, 130%y)                    'Android 4.4.4
        'fraContainer.SetLayout(0, 0, CLV.AsView.Width, CLV.AsView.Height) '120%y 'Android 9
        'fraContainer.SetLayout(0, 0, CLV.AsView.Width, CLV.AsView.Height + 15%y) 'Outros
    
        fraContainer.LoadLayout("layout_configuracoes")
        CLV.Add(fraContainer,1)
    
    End If
 
End Sub
 

Attachments

  • xCustomListViewer.zip
    503.1 KB · Views: 287
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
1.
If FirstTime=True Then

Activity.LoadLayout("layout_configuracoes_clv")
This is a bug. Watch the activities life cycle video tutorial: https://www.b4x.com/android/forum/threads/android-process-and-activities-life-cycle.6487/#content

2. Please use File - Export as zip when uploading projects.

3. The height of the configuration layout should be set to 710dip. It has no relation with CLV height.
B4X:
fraContainer.SetLayout(0, 0, CLV.AsView.Width, 710dip)
3b. Remove the call to AutoScaleAll from the configuration layout to prevent it from modifying the layout height.

4. Check B4XPreferencesDialog:
SS-2019-04-10_17.33.40.png


https://www.b4x.com/android/forum/t...esdialog-cross-platform-forms.103842/#content
 
Last edited:
Upvote 0
Top