When building Android app with Lazarus graphical form designer,
newly added visual components are added to the *.lfm file in the same order as they are added to TAndroid module MainForm.
However there is a serious bug when newly added visual components have property “PosRelativeToParent” at first [rpTop], then [rpBottom] and then again [rpTop].
Here is the example:
object EditText1: jEditText
PosRelativeToParent = [rpTop]
end
object EditText2: jEditText
PosRelativeToParent = [rpBottom, rpLeft]
end
object EditText3: jEditText
PosRelativeToParent = [rpTop]
end
When Android app is compiled and run, there is a problem: the third visual component EditText3 stays invisible and it is impossible to make it visible on the screen.
The bug workaround solution is following.
1) Close project in Lazarus;
2) Open *.lfm file with text editor and manually rearrange the order of visual components like this:
object EditText1: jEditText
PosRelativeToParent = [rpTop]
end
object EditText3: jEditText
PosRelativeToParent = [rpTop]
end
object EditText2: jEditText
PosRelativeToParent = [rpBottom, rpLeft]
end
At first must be all visual components which have property “PosRelativeToParent” as [rpTop],
and then below must be all visual components which have “PosRelativeToParent” as [rpBottom].
Save *.lfm file.
3) reopen the project in Lazarus, compile and run app on Android device. Now all visual components are visible.
Above is workaround solution for LAWM graphical form designer bug.
However somebody needs to fix this bug of graphical form designer (for Android apps) – visual components must be rearranged automatically in *.lfm file, when the property “PosRelativeToParent” is changed from [rpTop] to [rpBottom] and vice versa.