android - How to anchor a Widget to the bottom of an Activity, if the widget that was at that position is made invisible -
I found this situation, I have 4 widgets in the same layout in the following order: <
XML is:
& lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; RelativeLayout xmlns: Android = "http://schemas.android.com/apk/res/android" Android: layout_width = "match_parent" Android: layout_height = "match_parent" android: id = "@ + id / peddo client latable layout" & gt; & Lt; TextView Android: Android: Android: Android: Layout_LinePart Lift = "True" Android: Layout_AlgunatureTap = "True" Android: Maxline = "4" Android: Text = "Customer Name" /> & Lt; Android: layout_width = "fill_parent" Android: layout_height = "wrap_content" Android: layout_below = "@ + id / nameLabel" Android: Layout_Above = "@ + ID / Total Order Labels" Android: Orientation = "Vertical" & gt; & Lt; ListView Android: id = "@ + ID / Bookslistview" Android: layout_width = "match_parent" Android: layout_height = "fill_parent" Android: dividerHeight = "1dp" & gt; & Lt; / ListView & gt; & Lt; / LinearLayout & gt; & Lt; TextView android: id = "@ + id / totalOrdersLabel" Android: layout_above = "@ + id / confirmOrderButton" Android: layout_alignParentLeft = "true" android: text = "total" /> & Lt; Button Android: id = "@ + id / confirmOrderButton" Android: layout_alignParentBottom = "true" android: text = "confirm the order" /> & Lt; / RelativeLayout & gt; And
Enter image details here ">
As you can see this work, the problem occurs when I have to make buttons invisible based on some situations from Java. Then there is no control to use TextView android: layout_above = "@ + id / confirmOrderButton" above the button, and for this reason the layout and the list view shown at the top are not shown is. I think if I can remove android: layout_above = "@ + id / confirmOrderButton" from the second text view and add Android: layout_alignParentBottom = "True" , the problem should be fixed. The thing is that I do not know at all how to do it, so if you can help me then I will be truly grateful. Thanks in advance.
set totalOrdersLabel TextView's android: layout_alignWithParentIfMissing really. & lt; TextView Android: Android: Android: Android: Android: Android: Layout_AlternativePoint Left - "True" Android: Layout_LinigitapPrintEfmissing = "True" Android: Text = "Total" />
Comments
Post a Comment