I am looking for a spec or reference of all the possible options for the various XML layout attribute settings that typically come with an android UI. Google seem to be good at burying it. This is similar to this question but remains in-effectively answered.
Such as what are my options available to me for the TextView layout_width definition ? There must be a complete definition published … somehwere….
layout_*attributes aren’t directly part of the view they appear on, which is why you won’t find them in TextView’s documentation. (TextView is not a ViewGroup.) They are arguments to the parent view, also known asLayoutParams. Take a look at the “Known Subclasses” sections at the top of the linked page for a list of them. They’re instructions about how aViewGroupshould arrange each child view, and each parent type can recognize different ones depending on what kinds of layout options it supports.For example,
LinearLayout.LayoutParamssupports theandroid:layout_weightparameter. Children of aLinearLayoutcan specify weight to request a proportion of the remaining space after all children have been measured. You can give equal weight to two sibling TextViews with a base width of 0 to give them each half of the available space within the parent.