Loading docs/html/guide/topics/ui/declaring-layout.jd +4 −4 Original line number Original line Diff line number Diff line Loading @@ -88,8 +88,8 @@ to hold a {@link android.widget.TextView} and a {@link android.widget.Button}:</ <pre> <pre> <?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_width="match_parent" android:layout_height="fill_parent" android:layout_height="match_parent" android:orientation="vertical" > android:orientation="vertical" > <TextView android:id="@+id/text" <TextView android:id="@+id/text" android:layout_width="wrap_content" android:layout_width="wrap_content" Loading Loading @@ -215,14 +215,14 @@ set the width or height: </p> <ul> <ul> <li><var>wrap_content</var> tells your view to size itself to the dimensions <li><var>wrap_content</var> tells your view to size itself to the dimensions required by its content</li> required by its content</li> <li><var>fill_parent</var> (renamed <var>match_parent</var> in API Level 8) <li><var>match_parent</var> (named <var>fill_parent</var> before API Level 8) tells your view to become as big as its parent view group will allow.</li> tells your view to become as big as its parent view group will allow.</li> </ul> </ul> <p>In general, specifying a layout width and height using absolute units such as <p>In general, specifying a layout width and height using absolute units such as pixels is not recommended. Instead, using relative measurements such as pixels is not recommended. Instead, using relative measurements such as density-independent pixel units (<var>dp</var>), <var>wrap_content</var>, or density-independent pixel units (<var>dp</var>), <var>wrap_content</var>, or <var>fill_parent</var>, is a better approach, because it helps ensure that <var>match_parent</var>, is a better approach, because it helps ensure that your application will display properly across a variety of device screen sizes. your application will display properly across a variety of device screen sizes. The accepted measurement types are defined in the The accepted measurement types are defined in the <a href="{@docRoot}guide/topics/resources/available-resources.html#dimension"> <a href="{@docRoot}guide/topics/resources/available-resources.html#dimension"> Loading docs/html/guide/topics/ui/layout/grid.jd +4 −4 Original line number Original line Diff line number Diff line Loading @@ -41,8 +41,8 @@ result, with cell borders displayed as dotted lines (added for visual effect). < <pre> <pre> <?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_width="match_parent" android:layout_height="fill_parent" android:layout_height="match_parent" android:stretchColumns="1"> android:stretchColumns="1"> <TableRow> <TableRow> <TextView <TextView Loading Loading @@ -82,8 +82,8 @@ documentation for more details. </p> <pre> <pre> <?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_width="match_parent" android:layout_height="fill_parent" android:layout_height="match_parent" android:stretchColumns="1"> android:stretchColumns="1"> <TableRow> <TableRow> Loading docs/html/guide/topics/ui/layout/gridview.jd +3 −3 Original line number Original line Diff line number Diff line Loading @@ -45,8 +45,8 @@ into the project's <?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?> <GridView xmlns:android="http://schemas.android.com/apk/res/android" <GridView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/gridview" android:id="@+id/gridview" android:layout_width="fill_parent" android:layout_width="match_parent" android:layout_height="fill_parent" android:layout_height="match_parent" android:columnWidth="90dp" android:columnWidth="90dp" android:numColumns="auto_fit" android:numColumns="auto_fit" android:verticalSpacing="10dp" android:verticalSpacing="10dp" Loading docs/html/guide/topics/ui/layout/linear.jd +5 −5 Original line number Original line Diff line number Diff line Loading @@ -82,21 +82,21 @@ share the rest equally.</p> <pre> <pre> <?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_width="match_parent" android:layout_height="fill_parent" android:layout_height="match_parent" android:paddingLeft="16dp" android:paddingLeft="16dp" android:paddingRight="16dp" android:paddingRight="16dp" android:orientation="vertical" > android:orientation="vertical" > <EditText <EditText android:layout_width="fill_parent" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_height="wrap_content" android:hint="@string/to" /> android:hint="@string/to" /> <EditText <EditText android:layout_width="fill_parent" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_height="wrap_content" android:hint="@string/subject" /> android:hint="@string/subject" /> <EditText <EditText android:layout_width="fill_parent" android:layout_width="match_parent" android:layout_height="0dp" android:layout_height="0dp" android:layout_weight="1" android:layout_weight="1" android:gravity="top" android:gravity="top" Loading docs/html/guide/topics/ui/layout/relative.jd +4 −4 Original line number Original line Diff line number Diff line Loading @@ -82,13 +82,13 @@ view declared in the hierarchy. The example below demonstrates such a scenario.< <pre> <pre> <?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_width="match_parent" android:layout_height="fill_parent" android:layout_height="match_parent" android:paddingLeft="16dp" android:paddingLeft="16dp" android:paddingRight="16dp" > android:paddingRight="16dp" > <EditText <EditText android:id="@+id/name" android:id="@+id/name" android:layout_width="fill_parent" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_height="wrap_content" android:hint="@string/reminder" /> android:hint="@string/reminder" /> <Spinner <Spinner Loading Loading
docs/html/guide/topics/ui/declaring-layout.jd +4 −4 Original line number Original line Diff line number Diff line Loading @@ -88,8 +88,8 @@ to hold a {@link android.widget.TextView} and a {@link android.widget.Button}:</ <pre> <pre> <?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_width="match_parent" android:layout_height="fill_parent" android:layout_height="match_parent" android:orientation="vertical" > android:orientation="vertical" > <TextView android:id="@+id/text" <TextView android:id="@+id/text" android:layout_width="wrap_content" android:layout_width="wrap_content" Loading Loading @@ -215,14 +215,14 @@ set the width or height: </p> <ul> <ul> <li><var>wrap_content</var> tells your view to size itself to the dimensions <li><var>wrap_content</var> tells your view to size itself to the dimensions required by its content</li> required by its content</li> <li><var>fill_parent</var> (renamed <var>match_parent</var> in API Level 8) <li><var>match_parent</var> (named <var>fill_parent</var> before API Level 8) tells your view to become as big as its parent view group will allow.</li> tells your view to become as big as its parent view group will allow.</li> </ul> </ul> <p>In general, specifying a layout width and height using absolute units such as <p>In general, specifying a layout width and height using absolute units such as pixels is not recommended. Instead, using relative measurements such as pixels is not recommended. Instead, using relative measurements such as density-independent pixel units (<var>dp</var>), <var>wrap_content</var>, or density-independent pixel units (<var>dp</var>), <var>wrap_content</var>, or <var>fill_parent</var>, is a better approach, because it helps ensure that <var>match_parent</var>, is a better approach, because it helps ensure that your application will display properly across a variety of device screen sizes. your application will display properly across a variety of device screen sizes. The accepted measurement types are defined in the The accepted measurement types are defined in the <a href="{@docRoot}guide/topics/resources/available-resources.html#dimension"> <a href="{@docRoot}guide/topics/resources/available-resources.html#dimension"> Loading
docs/html/guide/topics/ui/layout/grid.jd +4 −4 Original line number Original line Diff line number Diff line Loading @@ -41,8 +41,8 @@ result, with cell borders displayed as dotted lines (added for visual effect). < <pre> <pre> <?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_width="match_parent" android:layout_height="fill_parent" android:layout_height="match_parent" android:stretchColumns="1"> android:stretchColumns="1"> <TableRow> <TableRow> <TextView <TextView Loading Loading @@ -82,8 +82,8 @@ documentation for more details. </p> <pre> <pre> <?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_width="match_parent" android:layout_height="fill_parent" android:layout_height="match_parent" android:stretchColumns="1"> android:stretchColumns="1"> <TableRow> <TableRow> Loading
docs/html/guide/topics/ui/layout/gridview.jd +3 −3 Original line number Original line Diff line number Diff line Loading @@ -45,8 +45,8 @@ into the project's <?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?> <GridView xmlns:android="http://schemas.android.com/apk/res/android" <GridView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/gridview" android:id="@+id/gridview" android:layout_width="fill_parent" android:layout_width="match_parent" android:layout_height="fill_parent" android:layout_height="match_parent" android:columnWidth="90dp" android:columnWidth="90dp" android:numColumns="auto_fit" android:numColumns="auto_fit" android:verticalSpacing="10dp" android:verticalSpacing="10dp" Loading
docs/html/guide/topics/ui/layout/linear.jd +5 −5 Original line number Original line Diff line number Diff line Loading @@ -82,21 +82,21 @@ share the rest equally.</p> <pre> <pre> <?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_width="match_parent" android:layout_height="fill_parent" android:layout_height="match_parent" android:paddingLeft="16dp" android:paddingLeft="16dp" android:paddingRight="16dp" android:paddingRight="16dp" android:orientation="vertical" > android:orientation="vertical" > <EditText <EditText android:layout_width="fill_parent" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_height="wrap_content" android:hint="@string/to" /> android:hint="@string/to" /> <EditText <EditText android:layout_width="fill_parent" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_height="wrap_content" android:hint="@string/subject" /> android:hint="@string/subject" /> <EditText <EditText android:layout_width="fill_parent" android:layout_width="match_parent" android:layout_height="0dp" android:layout_height="0dp" android:layout_weight="1" android:layout_weight="1" android:gravity="top" android:gravity="top" Loading
docs/html/guide/topics/ui/layout/relative.jd +4 −4 Original line number Original line Diff line number Diff line Loading @@ -82,13 +82,13 @@ view declared in the hierarchy. The example below demonstrates such a scenario.< <pre> <pre> <?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_width="match_parent" android:layout_height="fill_parent" android:layout_height="match_parent" android:paddingLeft="16dp" android:paddingLeft="16dp" android:paddingRight="16dp" > android:paddingRight="16dp" > <EditText <EditText android:id="@+id/name" android:id="@+id/name" android:layout_width="fill_parent" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_height="wrap_content" android:hint="@string/reminder" /> android:hint="@string/reminder" /> <Spinner <Spinner Loading