Недавно начал изучать Android API, а сегодня более менее разобрал основы синтакиса XML.
Затем стал разбирать следующий пример:
Код: Выделить всё
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="top"
android:orientation="vertical" >
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Кнопка 1" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Кнопка 2" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Кнопка 3" />
</LinearLayout>
1) Откуда берутся атрибуты android:layout_width и android:layout_height в элементе LinearLayout? Они не объявлены в классе LinearLayout и не присутствуют в списке унаследованных (Inherited XML Attributes). Я поискал и нашёл их во вложенном классе ViewGroup.LayoutParams класса ViewGroup. Т.е. вроде как эти атрибуты наследуются вместе со вложенным классом, но тогда почему они не указываются в Inherited XML Attributes ?
2) Откуда берутся атрибуты android:layout_width и android:layout_height в элементе Button? Ни в одном классе иерархии (View-TextView-Button) я их не нашёл...