Z zxxdaro Member Licensed User Longtime User Apr 6, 2012 #1 I am developing an app that makes extensive use of webviews that are incorporated in layouts When replacing a layout with another I find that it is placed over the old one and does not replace it. For example, buttons that were on the first are still apparent when I load the second. How to I clear the screen before loading a new layout?
I am developing an app that makes extensive use of webviews that are incorporated in layouts When replacing a layout with another I find that it is placed over the old one and does not replace it. For example, buttons that were on the first are still apparent when I load the second. How to I clear the screen before loading a new layout?
Erel B4X founder Staff member Licensed User Longtime User Apr 6, 2012 #2 There are several approaches. In most cases the best option is to use multiple activities. Each one with its own layout. Another option is to load the layout to a panel. Then when you want to remove the layout you can call Panel.RemoveView, create a new panel and load the layout to the new panel. Upvote 0
There are several approaches. In most cases the best option is to use multiple activities. Each one with its own layout. Another option is to load the layout to a panel. Then when you want to remove the layout you can call Panel.RemoveView, create a new panel and load the layout to the new panel.
D dbryan Member Licensed User Longtime User Oct 24, 2012 #3 Erel said: There are several approaches. In most cases the best option is to use multiple activities. Each one with its own layout. Another option is to load the layout to a panel. Then when you want to remove the layout you can call Panel.RemoveView, create a new panel and load the layout to the new panel. Click to expand... :sign0013: I know this is an old thread but could you show some code examples? That usually explains things to me easier. Upvote 0
Erel said: There are several approaches. In most cases the best option is to use multiple activities. Each one with its own layout. Another option is to load the layout to a panel. Then when you want to remove the layout you can call Panel.RemoveView, create a new panel and load the layout to the new panel. Click to expand... :sign0013: I know this is an old thread but could you show some code examples? That usually explains things to me easier.
Kbogle24 Member Licensed User Longtime User Oct 25, 2012 #4 Code: LoadLayoutToPanel ("simplelayout") Code: Sub LoadLayoutToPanel (Layout As String) If Panel1.IsInitialized Then Activity.RemoveViewAt(0) End If Panel1.Initialize("") Panel1.RemoveView Panel1.LoadLayout(Layout) 'layout that I want load Activity.AddView(Panel1, 0, 0, 100%x, 100%y) End Sub Hope that helps some. Upvote 0
Code: LoadLayoutToPanel ("simplelayout") Code: Sub LoadLayoutToPanel (Layout As String) If Panel1.IsInitialized Then Activity.RemoveViewAt(0) End If Panel1.Initialize("") Panel1.RemoveView Panel1.LoadLayout(Layout) 'layout that I want load Activity.AddView(Panel1, 0, 0, 100%x, 100%y) End Sub Hope that helps some.