Hi All
My first attempt to use Scrollview to hold a Label, a Button and an Imageview.
All four views have been defined in the designer. When I attempt to add anything to the scrollview I get an error log that the view already has a Parent and I should use removeview.
The label, Button and Imageview are Parented by the Main Activity.
I have read up the tutorials and examples but obviously missed something.
Any help appreciated.
Regards
Roger
My first attempt to use Scrollview to hold a Label, a Button and an Imageview.
All four views have been defined in the designer. When I attempt to add anything to the scrollview I get an error log that the view already has a Parent and I should use removeview.
The label, Button and Imageview are Parented by the Main Activity.
I have read up the tutorials and examples but obviously missed something.
Any help appreciated.
B4X:
Sub BtnFiles_click
Vibrate.Vibrate (75) ' Vibrate phone for 75 ms === Phone Library
Private b As Beeper ' Audio Library
b.Initialize(50, 600) ' 50 milliseconds, 600 hz
b.Beep
If File.Exists(File.DirRootExternal&"/ABT/", "") = False Then File.MakeDir(File.DirRootExternal&"/ABT/", "")
'Find file names. Select file to import
If FileName_flag = 0 Then
FileListing1.Clear
FileListing1 = FileLists.ListFiles(File.DirRootExternal & "/ABT/", "*.png", True, True)
FileSelect 'Returns Filename1
Return 'Ignore
End If
'CODE TO COLLECT XXX.png FOR PANEL REQUIRED HERE
ImgScreen.Width = 100%X
ImgScreen.Height = 100%y
ImgScreen.bitmap = LoadBitmap(File.DirRootExternal&"/ABT/", Filename1) 'Load Bmp to Imageview
lblTitle.Text = Filename1 'Load text to label
lblTitle.Height = 10%x
lblTitle.Width = 100%x
ListBack.Height = 10%x
ScreenScrollView.Height = 110%y
ScreenScrollView.Left = 0
ScreenScrollView.Top = 0
ScreenScrollView.BringToFront
ScreenScrollView.Panel.AddView(lblTitle,0,0,100%x,lblTitle.Height) 'Add Label
ScreenScrollView.Panel.AddView(ListBack,0,0,ListBack.Width, lblTitle.Height) 'Add Button
ScreenScrollView.Panel.AddView(ImgScreen,0, lblTitle.Height,ImgScreen.Width, ImgScreen.Height) 'Add Imageview
End Sub
Regards
Roger