Execute Script Designer dinamically

rclatorre

Member
Licensed User
Longtime User
Hello, I am allowing the user to choose a font size and need to run the Script Designer to the positions of the views are accommodated according to the layout.

I have seen that there is a call to Activity.RerunDesignerScript (LayoutFile As String, Int Ace Width, Height As Int) but I see that is a level of activity, I have a AHViewPager to handle Swipe and within each page to have placed a ScrollView Vertical scroll control (I loaded a ScrollView loyout the panel).

How do I call the Script Designer of each panel?

Thanks

Roberto
 

Theera

Well-Known Member
Licensed User
Longtime User
Have you ever try this code activity.RerunDesignerScript()
 
Upvote 0

rclatorre

Member
Licensed User
Longtime User
Yes, but get an error because it can not find a ImageView that is inside the ScrollView Panel.

That ImageView not level of Activity.

Than for your reply.


Roberto
 
Upvote 0

rclatorre

Member
Licensed User
Longtime User
This perfect Erel, what I did was:

1.Declare as global variables the views (buttom, label, EditText, etc) I have in my layout.

Sub Globals
*** Dim name As Label
*** Dim accept As Button
Dim scv() As ScrollView
End Sub

2.After referencing variables to each view that is in the panel of ScrollView

Sub MyResize
Dim Pan As Panel

'Access scrollview panel
Pan=scv(0).Panel

'Referencing views of panel
***** name = Pan.GetView(0)
***** accept = Pan.GetView(1)
****** ......

'Resize height of name view
***** name.Height = 40

3.Call the command:
***** ......
'Call Designer Script defined into layout
**** Activity.RerunDesignerScript ("publications_swipe" Activity.Width, accept.Height accept.Top + 100)

Worked.

Thanks

Roberto
 
Upvote 0
Top