Dieter Baumgartner Member Licensed User Longtime User Jan 4, 2021 #1 Hello, i try to create Anotherprogressbar inside a BBCodeview. Code: Copy Dim pb As AnotherProgressBar pb.Initialize(Root,"sw") pb.mBase.SetLayoutAnimated(0,0,0,500dip,30dip) I always get java.lang.RuntimeException: Object should first be initialized (B4XView) in Line 3. What is wrong with pb.initialize ? It is a B4Xpage, so i call ROOT as Callback. Has anyone createt Anotherprogressbar by code ?
Hello, i try to create Anotherprogressbar inside a BBCodeview. Code: Copy Dim pb As AnotherProgressBar pb.Initialize(Root,"sw") pb.mBase.SetLayoutAnimated(0,0,0,500dip,30dip) I always get java.lang.RuntimeException: Object should first be initialized (B4XView) in Line 3. What is wrong with pb.initialize ? It is a B4Xpage, so i call ROOT as Callback. Has anyone createt Anotherprogressbar by code ?
Erel B4X founder Staff member Licensed User Longtime User Jan 4, 2021 #2 [B4X] I need 100 <custom view here>s. How to add programmatically? Custom views are designed to be added with the designer. It is however very simple to create a layout file with the custom view and load it multiple times. Tip: remove the call to AutoScaleAll from the designer script. Complete example: Sub Globals Private B4XSwitch1 As B4XSwitch End... www.b4x.com Upvote 0
[B4X] I need 100 <custom view here>s. How to add programmatically? Custom views are designed to be added with the designer. It is however very simple to create a layout file with the custom view and load it multiple times. Tip: remove the call to AutoScaleAll from the designer script. Complete example: Sub Globals Private B4XSwitch1 As B4XSwitch End... www.b4x.com
Dieter Baumgartner Member Licensed User Longtime User Jan 4, 2021 #3 Thank you Erel, i didn't know that Custom views are designed to be added with the designer. ] Click to expand... So i get a problem when i make B4X: Copy Root.LoadLayout("ProgressBar") 'load a layout with one Element of type Anotherprogressbar BBCodeView1.Views.Put("pb", pb) 'put to a BBcodeview because it puts the Progressbar already on top visible and not only in the BBcodeview Listitem. I also wanted to achieve clicking a Checkbox and then changing the Value of the AnotherProgressbar inside the same Listitem of BBcodeview. It seems that this is not possible with BBcodeview, i cannot touch this element directly. I would have to store the value and redraw the whole BBcodeview, right ? Upvote 0
Thank you Erel, i didn't know that Custom views are designed to be added with the designer. ] Click to expand... So i get a problem when i make B4X: Copy Root.LoadLayout("ProgressBar") 'load a layout with one Element of type Anotherprogressbar BBCodeView1.Views.Put("pb", pb) 'put to a BBcodeview because it puts the Progressbar already on top visible and not only in the BBcodeview Listitem. I also wanted to achieve clicking a Checkbox and then changing the Value of the AnotherProgressbar inside the same Listitem of BBcodeview. It seems that this is not possible with BBcodeview, i cannot touch this element directly. I would have to store the value and redraw the whole BBcodeview, right ?
Erel B4X founder Staff member Licensed User Longtime User Jan 5, 2021 #4 Dieter Baumgartner said: I would have to store the value and redraw the whole BBcodeview, right ? Click to expand... No. You have a reference to the view and you can do whatever you like. ProgressBar is not a view by itself. You need to add pb.mBase to the Views map. Upvote 0
Dieter Baumgartner said: I would have to store the value and redraw the whole BBcodeview, right ? Click to expand... No. You have a reference to the view and you can do whatever you like. ProgressBar is not a view by itself. You need to add pb.mBase to the Views map.