iOS Question An example of ScrollView in b4i

BerlinCoder

Member
Licensed User
Hi,

It seems scrollview in b4i and b4a are difference. So, can anybody give me an example how to work with b4i scrollview in order to load panels inside of the scrollview?
 

tufanv

Expert
Licensed User
Longtime User
Hi,

It seems scrollview in b4i and b4a are difference. So, can anybody give me an example how to work with b4i scrollview in order to load panels inside of the scrollview?
They are not different. Both use scroll.panel.addview to add views. Only difference i can remember is for b4i we use scroll.contentheight and contentwidth instead of scroll.panel.width and scroll.panel.height.
 
Upvote 0

BerlinCoder

Member
Licensed User
I used similar approach like b4a : 1 - put a panel on a layout 2- set scrollview on it and try to add panels on at run-time
Bu the now the problem is the transparency of scroll-view or panel

please take a look at following snippet codes

B4X:
    cv1.Initialize(Me,"scroll",100%x)
    cv1.Clear
    pnlsv.AddView(cv1.AsView,0,0,100%x,100%y)
    pnlsv.Color=Colors.Transparent


B4X:
                Dim Pnl_Qeustion As Panel
                Pnl_Qeustion.Initialize("")
                cv1.Add(Pnl_Qeustion,150dip,"")
                Pnl_Qeustion.LoadLayout("Template_Panel_Question_History_English")

The result is still with a background color although I changed the Template_Panel_Question_History_English to transparent color , .. .. In b4a it works!, But in b4i it does not work!
 
Upvote 0

BerlinCoder

Member
Licensed User
Thanks you solution seems works. I have a little bit problem with transparency of the first view ( only this one has a black background!). If I could not I will send it to you.
 
Upvote 0

BerlinCoder

Member
Licensed User
Yeah, I have attached the module. I must now I see a black background only for the first view on my simulator iPhone SE. But, for the rest of view the background is transparent.
 

Attachments

  • pageHistoryEnglish.bas
    3.6 KB · Views: 252
Upvote 0

ilan

Expert
Licensed User
Longtime User
Try to change the scrollview.panel color also to transparent. But as erel already mentioned the best way is to upload a small example like this we can know what u r trying to do and if u r doing something wrong.
 
Upvote 0
Top