Android Tutorial ScrollView examples summary

mrussell014

Member
Licensed User
Longtime User
database save after creation

Hi Erel,

Not sure how to start a new thread thay will post in the correct place. All my code works. Just can't find my database at the close of the app. I want to reopen the database that was updated. Does everyone in B4A distroy their database when they close there app. I was hoping someone would have done this and show me what I am going to figure. I have people waiting to see this program so they will have to continue to wait.

Thanks all,

Mike
 

GMan

Well-Known Member
Licensed User
Longtime User
As i am rather new in B4A i have some pricipal problems with understanding some things.

After some days of working with B4A i have a test app, which makes all things i will be tested.

Most of them works, but now i tried since hours to make a scrollable list with text AND pictures in a TabHost - but can't work it out.
The TabHost works, the different views etc. are loaded and so, this is good.

Searched through MB of examples, but no one semmes to be fitting to my belonging,to make this text pictures scrollable - so that i could use it as a base for the own development.

Is there a (best) simple command for that or has anyone a function, that woul d work ?

Thx in advance
 

GMan

Well-Known Member
Licensed User
Longtime User
Thx...this will help a little bit, but still cant put text and pics.

I ask in the thread of the CustomListView-part to solve that...
 

luke2012

Well-Known Member
Licensed User
Longtime User
Hi to all,
for the imageview with label there is a sample file ?
 

surfer

Member
Licensed User
Longtime User
Klaus. In the demo Tabhost & Scrollview the last visible blue line has text “Text1 line # 14” but must be “Text1 line # 15”. Similarly the last visible red line has text “Text2 line # 19” but must be “Text2 line # 20”. So we cannot see all rows. How to repair this?
 
Last edited:

klaus

Expert
Licensed User
Longtime User
You are right !
The end of the filling routines should be :
B4X:
Next
scvTest1.Panel.Height = i * lblHeight1
instead of:
B4X:
    scvTest1.Panel.Height = i1 * lblHeight1
Next
Same for scvTest2.

Updated the program in the original post here.

Best regards.
 

mitsusdev

Member
Licensed User
Longtime User
i am trying to use the use scroolview with design tools

but I do not understand how to draw the interface.

I have a group of buttons and labels and want to be sure you can see everything in the various video resolutions.

thanks
 

Attachments

  • Immagine.JPG
    146.6 KB · Views: 645

klaus

Expert
Licensed User
Longtime User
You have different possibilities, the two below and any combination:

- add all views in the code
add the ScrollView onto the Activity
add all the views onto the ScrollView.Panel
set the ScrollView.Panel.Height

- define one layout with the ScrollView and a second layout with a Panel containing the different views, this Panel can be heigher than the ScrollView.
load the ScrollView layout onto the Activity
load the Panel layout onto the ScrollView.Panel
set the ScrollView.Panel.Height to the Panel.Height

Best regards.
 

StarinschiAndrei

Active Member
Licensed User
Longtime User
Can anybody tell me how can i center my listview in tabhost ? or how can i determinate the tab bottom value and tabhost bottom value ?
here is my code :

Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Dim pet,paper,cfg,tv,other As Bitmap

pet=LoadBitmap(File.DirAssets, "pet.png")
paper=LoadBitmap(File.DirAssets,"paper.png")
tv=LoadBitmap(File.DirAssets,"tv.png")
cfg =LoadBitmap(File.DirAssets,"config.png" )
other=LoadBitmap(File.DirAssets,"other.png" )

Activity.LoadLayout("Main")

Activity.AddMenuItem2("Settings","Settings",cfg)
Activity.AddMenuItem("Disconnect", "mnuDisconnect")
tabArticles.AddTabWithIcon("Pet",pet,pet,"articlelist")

lv1.Initialize("ListView1")
For i = 1 To 300
lv1.AddSingleLine("Item #" & i)
Next
Activity.AddView(lv1, 20%x ,0, 100%x, 30%y)

tabArticles.AddTabWithIcon("Hartie",paper,paper,"articlelist")
tabArticles.AddTabWithIcon("Electronice",tv,tv,"articlelist")
tabArticles.AddTabWithIcon("Altele",other,other,"articlelist")

End Sub

There is any possibility to populate each tab in tabhost with labels or images ?
Thank you
 

Attachments

  • Screenshot_2013-10-07-22-39-06.png
    93.5 KB · Views: 579

GMan

Well-Known Member
Licensed User
Longtime User
Is it possible to get the scrolled percentage or position of the ScrollView ?
I want to make a tab(1) of a tabhost only then visible if the scrollview of the previous tab(0) is scrolled to 100% (maybe 95%)
 

GMan

Well-Known Member
Licensed User
Longtime User
SOLVED

I "found" the ScrollChanged-Event
B4X:
Sub InfosSV_ScrollChanged (Position As Int)
If InfosSV.ScrollPosition  > 6050 Then
    Msgbox("Reached","6050")
End If
End Sub

But how to disable/enable a single TabHost.Tab ?
I start a new question
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…