рджреЗрд╢реА Android рдЕрдиреБрдкреНрд░рдпреЛрдЧреЛрдВ рдХреЗ рд▓рд┐рдП рд▓реЗрдЖрдЙрдЯ рдореВрд▓ рдмрд╛рддреЗрдВ

рдпрд╣ рдкреЛрд╕реНрдЯ рдореВрд▓ рдПрдВрдбреНрд░реЙрдЗрдб рдПрдкреНрд▓рд┐рдХреЗрд╢рди рдмрдирд╛рддреЗ рд╕рдордп рд▓реЗрдЖрдЙрдЯ рдореБрджреНрджреЛрдВ рдХреЛ рдХрд╡рд░ рдХрд░реЗрдЧрд╛ред рд░реЗрд╕ / рд▓реЗрдЖрдЙрдЯ / рдирд┐рд░реНрджреЗрд╢рд┐рдХрд╛ рд╕реЗ xml рдлрд╝рд╛рдЗрд▓реЛрдВ рдореЗрдВ рд╡рд░реНрдгрд┐рдд рд▓реЗрдЖрдЙрдЯред рддреЛ, рдЪрд▓рд┐рдП рд╢реБрд░реВ рдХрд░рддреЗ рд╣реИрдВ:
рд▓реЗрдЖрдЙрдЯ рдХреЗ рдкрд╛рдБрдЪ рдорд╛рдирдХ рдкреНрд░рдХрд╛рд░ рд╣реИрдВ:


AbsoluteLayout

(рдЕрдиреБрд╢рдВрд╕рд┐рдд рдирд╣реАрдВ, рдкрджрд╛рд╡рдирдд рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░реЗрдВ)
рдирд┐рд░рдкреЗрдХреНрд╖рддрд╛ - рдХрд╛ рдЕрд░реНрде рд╣реИ рдХрд┐ рдкреНрд░рддреНрдпреЗрдХ рд▓реЗрдЖрдЙрдЯ рддрддреНрд╡ рдореЗрдВ x рдФрд░ y рдирд┐рд░реНрджреЗрд╢рд╛рдВрдХ рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рдХреЗ рдирд┐рд░реНрджрд┐рд╖реНрдЯ рд╕реНрдХреНрд░реАрди рдХреЗ рдКрдкрд░реА рдмрд╛рдПрдВ рдХреЛрдиреЗ рдХреЗ рд╕рд╛рдкреЗрдХреНрд╖ рдПрдХ рдкреВрд░реНрдг рд╕реНрдерд┐рддрд┐ рд╣реЛрдЧреАред рдпрд╛рдиреА AbsoluteLayout рдХреЗ рд╕рд╛рде рд╕реНрдХреНрд░реАрди рдХреЗ рдКрдкрд░реА рдмрд╛рдПрдВ рдХреЛрдиреЗ рдореЗрдВ рдирд┐рд░реНрджреЗрд╢рд╛рдВрдХ x = 0, y = 0 рд╣реИред
рд╕реНрдерд┐рддрд┐ рдПрдВрдбреНрд░реЙрдЗрдб рдХреА рд╡рд┐рд╢реЗрд╖рддрд╛рдУрдВ рдореЗрдВ рдирд┐рд░реНрджрд┐рд╖реНрдЯ рдХреА рдЧрдИ рд╣реИ: рд▓реЗрдЖрдЙрдЯ_рдПрдХреНрд╕ рдФрд░ рдПрдВрдбреНрд░реЙрдЗрдб: рд▓реЗрдЖрдЙрдЯ_рдп рддрддреНрд╡ред
рдХреЛрдб рдЙрджрд╛рд╣рд░рдг:
<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <Button android:id="@+id/backbutton" android:text="Back" android:layout_x="10px" android:layout_y="5px" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <TextView android:layout_x="10px" android:layout_y="110px" android:text="First Name" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <EditText android:layout_x="150px" android:layout_y="100px" android:width="100px" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <TextView android:layout_x="10px" android:layout_y="160px" android:text="Last Name" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <EditText android:layout_x="150px" android:layout_y="150px" android:width="100px" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </AbsoluteLayout> 



FrameLayout


рдлреНрд░реЗрдо-рдЖрдЙрдЯ - рд▓реЗрдЖрдЙрдЯ рдХрд╛ рдкреНрд░рдХрд╛рд░ рдЬрд┐рд╕рдХреЗ рдЕрдВрджрд░ рдкреНрд░рддрд┐ рдкрдВрдХреНрддрд┐ рдХреЗрд╡рд▓ рдПрдХ рддрддреНрд╡ рдкреНрд░рджрд░реНрд╢рд┐рдд рдХрд┐рдпрд╛ рдЬрд╛ рд╕рдХрддрд╛ рд╣реИред рдпрд╛рдиреА рдпрджрд┐ рдЖрдк FrameLayout рдХреЗ рдЕрдВрджрд░ рдХрдИ рддрддреНрд╡ рд░рдЦрддреЗ рд╣реИрдВ, рддреЛ рдЕрдЧрд▓реЗ рд╡рд╛рд▓реЗ рдХреЛ рдкрд┐рдЫрд▓реЗ рд╡рд╛рд▓реЗ рдХреЗ рдКрдкрд░ рдкреНрд░рджрд░реНрд╢рд┐рдд рдХрд┐рдпрд╛ рдЬрд╛рдПрдЧрд╛ред
рдХреЛрдб рдЙрджрд╛рд╣рд░рдг:
 <FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <ImageView android:src="@drawable/icon" android:scaleType="fitCenter" android:layout_height="fill_parent" android:layout_width="fill_parent"/> <TextView android:text="Learn-Android.com" android:textSize="24sp" android:textColor="#000000" android:layout_height="fill_parent" android:layout_width="fill_parent" android:gravity="center"/> </FrameLayout> 



LinearLayout


рд░реЗрдЦреАрдп рд▓рдпрдЖрдЙрдЯ - рдПрдХ рдкреНрд░рдХрд╛рд░ рдХрд╛ рд▓реЗрдЖрдЙрдЯ рдЬрд┐рд╕рдореЗрдВ рд▓реЗрдЖрдЙрдЯ рдХреНрд╖реЗрддреНрд░ рдХреЛ рд▓рд╛рдЗрдиреЛрдВ рдореЗрдВ рд╡рд┐рднрд╛рдЬрд┐рдд рдХрд┐рдпрд╛ рдЬрд╛рддрд╛ рд╣реИ рдФрд░ рдкреНрд░рддреНрдпреЗрдХ рдкрдВрдХреНрддрд┐ рдореЗрдВ рдПрдХ рддрддреНрд╡ рд░рдЦрд╛ рдЬрд╛рддрд╛ рд╣реИред рд╡рд┐рднрд╛рдЬрди рдКрд░реНрдзреНрд╡рд╛рдзрд░ рдпрд╛ рдХреНрд╖реИрддрд┐рдЬ рд╣реЛ рд╕рдХрддрд╛ рд╣реИ, рд╡рд┐рднрд╛рдЬрди рдХрд╛ рдкреНрд░рдХрд╛рд░ рд╡рд┐рд╢реЗрд╖рддрд╛ LinearLayout Android: рдУрд░рд┐рдПрдВрдЯреЗрд╢рди рдореЗрдВ рдирд┐рд░реНрджрд┐рд╖реНрдЯ рд╣реИред рд▓реЗрдЖрдЙрдЯ рдХреЗ рдЕрдВрджрд░ рдКрд░реНрдзреНрд╡рд╛рдзрд░ рдФрд░ рдХреНрд╖реИрддрд┐рдЬ рд▓реЗрдЖрдЙрдЯ рдХреЛ рд╕рдВрдпреЛрдЬрд┐рдд рдХрд░рдирд╛ рд╕рдВрднрд╡ рд╣реИ, рдФрд░ рдЗрд╕рдХреЗ рдЕрд▓рд╛рд╡рд╛, рдХрдИ рдЕрд▓рдЧ-рдЕрд▓рдЧ рдкреНрд░рдХрд╛рд░ рдХреЗ рдЯрд╛рдЗрдкрд╕реЗрдЯрд┐рдВрдЧ рдХрд╛ рд╕рдВрдпреЛрдЬрди рд╕рдВрднрд╡ рд╣реИ, рдЙрджрд╛рд╣рд░рдг рдХреЗ рд▓рд┐рдП, рдлреНрд░реЗрдорд▓реЗрдпрдЖрдЙрдЯ рдХреЗ рдЕрдВрджрд░ рд░реИрдЦрд┐рдХрд▓реЗрдпреВрдЯ рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рдирд╛ред

рд░реЗрдЦреАрдп рд▓рдпрдЖрдЙрдЯ рдКрд░реНрдзреНрд╡рд╛рдзрд░ рдЯреВрдЯрдиреЗ рдХрд╛ рдЙрджрд╛рд╣рд░рдг:
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" /> <Button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" /> <Button android:id="@+id/button3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" /> </LinearLayout> 



рд░реЗрдЦреАрдп рд▓рдпрдЖрдЙрдЯ рдХреНрд╖реИрддрд┐рдЬ рдЯреВрдЯрдиреЗ рдХрд╛ рдЙрджрд╛рд╣рд░рдг:
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent"> <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" /> <Button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" /> <Button android:id="@+id/button3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" /> </LinearLayout> 



рдХрдИ рд░реИрдЦрд┐рдХ рдХреЗ рд╕рдВрдпреЛрдЬрди:
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent"> <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" /> <Button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" /> <Button android:id="@+id/button3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" /> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" /> <Button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" /> <Button android:id="@+id/button3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" /> </LinearLayout> </LinearLayout> 



RelativeLayout


RelativeLayout - рд▓реЗрдЖрдЙрдЯ рдХрд╛ рдкреНрд░рдХрд╛рд░ рдЬрд┐рд╕рдореЗрдВ рддрддреНрд╡реЛрдВ рдХреА рд╕реНрдерд┐рддрд┐ рдПрдХ рджреВрд╕рд░реЗ рдХреЗ рд╕рд╛рдкреЗрдХреНрд╖ рд╣реЛрддреА рд╣реИ рдФрд░ рдореБрдЦреНрдп рдХрдВрдЯреЗрдирд░ рдХреЗ рд╕рд╛рдкреЗрдХреНрд╖ рд╣реЛрддреА рд╣реИред
рддрддреНрд╡реЛрдВ рдХреЛ рдХреИрд╕реЗ рд░рдЦрд╛ рдЬрд╛рдПрдЧрд╛, рдЗрд╕рдХреЗ рд▓рд┐рдП рдирд┐рдореНрдирд▓рд┐рдЦрд┐рдд рд╡рд┐рд╢реЗрд╖рддрд╛рдПрдВ рдЬрд┐рдореНрдореЗрджрд╛рд░ рд╣реИрдВ:
рдХрдВрдЯреЗрдирд░ рдкреЛрдЬрд┐рд╢рдирд┐рдВрдЧ рд╡рд┐рд╢реЗрд╖рддрд╛рдПрдБ

рдкреЛрдЬрд┐рд╢рдирд┐рдВрдЧ рдЕрдиреНрдп рддрддреНрд╡реЛрдВ рдХреЗ рд╕рд╛рдкреЗрдХреНрд╖ рд╡рд┐рд╢реЗрд╖рддрд╛ рд╣реИред
рдЗрди рд╡рд┐рд╢реЗрд╖рддрд╛рдУрдВ рдХреЗ рдореВрд▓реНрдп рдЙрд╕ рддрддреНрд╡ рдХреА рдЖрдИрдбреА рд╣реИрдВ рдЬрд┐рд╕рдХреЗ рд╕рд╛рдкреЗрдХреНрд╖ рд╕реНрдерд┐рддрд┐ рдкреНрд░рджрд░реНрд╢рд┐рдд рдХреА рдЬрд╛рдПрдЧреАред

Android: layout_above - рдирд┐рд░реНрджрд┐рд╖реНрдЯ рд╕реЗ рдКрдкрд░ рдХреА рд╡рд╕реНрддреБ рдХреЛ рджрд░реНрд╢рд╛рддрд╛ рд╣реИ
Android: layout_below - рдирд┐рд░реНрджрд┐рд╖реНрдЯ рд╕реЗ рдиреАрдЪреЗ рдХреА рд╡рд╕реНрддреБ рдХреЛ рджрд░реНрд╢рд╛рддрд╛ рд╣реИ
Android: Layout_toLeftOf - рдирд┐рд░реНрджрд┐рд╖реНрдЯ рдХреЗ рдмрд╛рдИрдВ рдУрд░ рд╕реНрдерд┐рддрд┐рдпрд╛рдБ рджреЗрддрд╛ рд╣реИ
Android: layout_toRightOf - рдирд┐рд░реНрджрд┐рд╖реНрдЯ рдХреЗ рджрд╛рдИрдВ рдУрд░ рд╕реНрдерд┐рддрд┐рдпрд╛рдВ рдмрддрд╛рддрд╛ рд╣реИ

рдЕрдиреНрдп рддрддреНрд╡реЛрдВ рдХреЗ рд▓рд┐рдП рд╕рдВрд░реЗрдЦрдгред

Android: Layout_alignBaseline - рдирд┐рд░реНрджрд┐рд╖реНрдЯ рддрддреНрд╡ рдХреА рдЖрдзрд╛рд░ рд░реЗрдЦрд╛ рдХреЗ рд╕рд╛рде рдПрдХ рддрддреНрд╡ рдХреА рдЖрдзрд╛рд░ рд░реЗрдЦрд╛ рд╕рдВрд░реЗрдЦрд┐рдд рдХрд░рддрд╛ рд╣реИ
Android: Layout_alignBottom - рдирд┐рд░реНрджрд┐рд╖реНрдЯ рддрддреНрд╡ рдХреЗ рдиреАрдЪреЗ рдПрдХ рддрддреНрд╡ рдХреЗ рдиреАрдЪреЗ рд╕рдВрд░реЗрдЦрд┐рдд рдХрд░рддрд╛ рд╣реИ
Android: layout_alignLeft - рдирд┐рд░реНрджрд┐рд╖реНрдЯ рддрддреНрд╡ рдХреЗ рдмрд╛рдПрдВ рдХрд┐рдирд╛рд░реЗ рдХреЗ рд╕рд╛рде рдПрдХ рддрддреНрд╡ рдХреЗ рдмрд╛рдПрдВ рдХрд┐рдирд╛рд░реЗ рдХреЛ рд╕рдВрд░реЗрдЦрд┐рдд рдХрд░рддрд╛ рд╣реИ
Android: layout_alignRight - рдирд┐рд░реНрджрд┐рд╖реНрдЯ рддрддреНрд╡ рдХреЗ рджрд╛рд╣рд┐рдиреЗ рдХрд┐рдирд╛рд░реЗ рдХреЗ рд╕рд╛рде рдПрдХ рддрддреНрд╡ рдХреЗ рджрд╛рд╣рд┐рдиреЗ рдХрд┐рдирд╛рд░реЗ рдХреЛ рд╕рдВрд░реЗрдЦрд┐рдд рдХрд░рддрд╛ рд╣реИ
Android: layout_alignTop - рдирд┐рд░реНрджрд┐рд╖реНрдЯ рддрддреНрд╡ рдХреЗ рд╢реАрд░реНрд╖ рдХреЗ рд╕рд╛рде рддрддреНрд╡ рдХреЗ рд╢реАрд░реНрд╖ рдХреЛ рд╕рдВрд░реЗрдЦрд┐рдд рдХрд░рддрд╛ рд╣реИ
 <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <Button android:id="@+id/backbutton" android:text="Back" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <TextView android:id="@+id/firstName" android:text="First Name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/backbutton" /> <EditText android:id="@+id/editFirstName" android:width="100px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/firstName" android:layout_below="@id/backbutton"/> <EditText android:id="@+id/editLastName" android:width="100px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/editFirstName" android:layout_alignLeft="@id/editFirstName"/> <TextView android:id="@+id/lastName" android:text="Last Name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline = "@id/editLastName" android:layout_below="@id/editFirstName" /> </RelativeLayout> 



TableLayout


рдЯреЗрдмрд▓ рд▓реЗрдЖрдЙрдЯ - рдЯреЗрдмрд▓ рд▓реЗрдЖрдЙрдЯред
рдХрд┐рд╕реА рддрд╛рд▓рд┐рдХрд╛ рдХреА рдкрдВрдХреНрддрд┐рдпреЛрдВ рдФрд░ рд╕реНрддрдВрднреЛрдВ рдореЗрдВ рдЖрдЗрдЯрдо рд╡реНрдпрд╡рд╕реНрдерд┐рдд рдХрд░рддрд╛ рд╣реИред
рдЯреИрдЧ рдХрд╛ рдЙрдкрдпреЛрдЧ рд╕реНрдЯреНрд░рд┐рдВрдЧреНрд╕ рдХреЛ рд╡реНрдпрд╡рд╕реНрдерд┐рдд рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП рдХрд┐рдпрд╛ рдЬрд╛рддрд╛ рд╣реИред
 ,           . 
android:layout_span.
, , android:layout_column
<TableLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <TableRow> <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column1" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column2" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column 3" android:textAppearance="?android:attr/textAppearanceMedium"/> </TableRow> <TableRow> <TextView android:id="@+id/textViewSpan" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" span three column" android:layout_span = "3" android:textSize="23sp" android:textAppearance="?android:attr/textAppearanceMedium"/> </TableRow> </TableLayout>



Alternate Layouts
Alternate Layouts - . .
XML :

res/layout-land тАУ landscape UI
res/layout-port тАУ portrait UI
res/lauout-square тАУ square UI

res/lauout .

.

.
:
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="#00FF00" android:typeface="monospace" android:text="@string/hello" />

xml res/values/
:
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="CodeFont" parent="@android:style/TextAppearance.Medium"> <item name="android:layout_width">fill_parent</item> <item name="android:layout_height">wrap_content</item> <item name="android:textColor">#00FF00</item> <item name="android:typeface">monospace</item> </style> </resources>
, style.
<TextView style="@style/CodeFont" android:text="@string/hello" />
, .
android:layout_span.
, , android:layout_column
<TableLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <TableRow> <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column1" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column2" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column 3" android:textAppearance="?android:attr/textAppearanceMedium"/> </TableRow> <TableRow> <TextView android:id="@+id/textViewSpan" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" span three column" android:layout_span = "3" android:textSize="23sp" android:textAppearance="?android:attr/textAppearanceMedium"/> </TableRow> </TableLayout>



Alternate Layouts
Alternate Layouts - . .
XML :

res/layout-land тАУ landscape UI
res/layout-port тАУ portrait UI
res/lauout-square тАУ square UI

res/lauout .

.

.
:
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="#00FF00" android:typeface="monospace" android:text="@string/hello" />

xml res/values/
:
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="CodeFont" parent="@android:style/TextAppearance.Medium"> <item name="android:layout_width">fill_parent</item> <item name="android:layout_height">wrap_content</item> <item name="android:textColor">#00FF00</item> <item name="android:typeface">monospace</item> </style> </resources>
, style.
<TextView style="@style/CodeFont" android:text="@string/hello" />

, .
android:layout_span.
, , android:layout_column
<TableLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <TableRow> <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column1" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column2" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column 3" android:textAppearance="?android:attr/textAppearanceMedium"/> </TableRow> <TableRow> <TextView android:id="@+id/textViewSpan" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" span three column" android:layout_span = "3" android:textSize="23sp" android:textAppearance="?android:attr/textAppearanceMedium"/> </TableRow> </TableLayout>



Alternate Layouts
Alternate Layouts - . .
XML :

res/layout-land тАУ landscape UI
res/layout-port тАУ portrait UI
res/lauout-square тАУ square UI

res/lauout .

.

.
:
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="#00FF00" android:typeface="monospace" android:text="@string/hello" />

xml res/values/
:
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="CodeFont" parent="@android:style/TextAppearance.Medium"> <item name="android:layout_width">fill_parent</item> <item name="android:layout_height">wrap_content</item> <item name="android:textColor">#00FF00</item> <item name="android:typeface">monospace</item> </style> </resources>
, style.
<TextView style="@style/CodeFont" android:text="@string/hello" />

, .
android:layout_span.
, , android:layout_column
<TableLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <TableRow> <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column1" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column2" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column 3" android:textAppearance="?android:attr/textAppearanceMedium"/> </TableRow> <TableRow> <TextView android:id="@+id/textViewSpan" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" span three column" android:layout_span = "3" android:textSize="23sp" android:textAppearance="?android:attr/textAppearanceMedium"/> </TableRow> </TableLayout>



Alternate Layouts
Alternate Layouts - . .
XML :

res/layout-land тАУ landscape UI
res/layout-port тАУ portrait UI
res/lauout-square тАУ square UI

res/lauout .

.

.
:
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="#00FF00" android:typeface="monospace" android:text="@string/hello" />

xml res/values/
:
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="CodeFont" parent="@android:style/TextAppearance.Medium"> <item name="android:layout_width">fill_parent</item> <item name="android:layout_height">wrap_content</item> <item name="android:textColor">#00FF00</item> <item name="android:typeface">monospace</item> </style> </resources>
, style.
<TextView style="@style/CodeFont" android:text="@string/hello" />

, .
android:layout_span.
, , android:layout_column
<TableLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <TableRow> <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column1" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column2" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column 3" android:textAppearance="?android:attr/textAppearanceMedium"/> </TableRow> <TableRow> <TextView android:id="@+id/textViewSpan" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" span three column" android:layout_span = "3" android:textSize="23sp" android:textAppearance="?android:attr/textAppearanceMedium"/> </TableRow> </TableLayout>



Alternate Layouts
Alternate Layouts - . .
XML :

res/layout-land тАУ landscape UI
res/layout-port тАУ portrait UI
res/lauout-square тАУ square UI

res/lauout .

.

.
:
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="#00FF00" android:typeface="monospace" android:text="@string/hello" />

xml res/values/
:
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="CodeFont" parent="@android:style/TextAppearance.Medium"> <item name="android:layout_width">fill_parent</item> <item name="android:layout_height">wrap_content</item> <item name="android:textColor">#00FF00</item> <item name="android:typeface">monospace</item> </style> </resources>
, style.
<TextView style="@style/CodeFont" android:text="@string/hello" />

, .
android:layout_span.
, , android:layout_column
<TableLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <TableRow> <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column1" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column2" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column 3" android:textAppearance="?android:attr/textAppearanceMedium"/> </TableRow> <TableRow> <TextView android:id="@+id/textViewSpan" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" span three column" android:layout_span = "3" android:textSize="23sp" android:textAppearance="?android:attr/textAppearanceMedium"/> </TableRow> </TableLayout>



Alternate Layouts
Alternate Layouts - . .
XML :

res/layout-land тАУ landscape UI
res/layout-port тАУ portrait UI
res/lauout-square тАУ square UI

res/lauout .

.

.
:
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="#00FF00" android:typeface="monospace" android:text="@string/hello" />

xml res/values/
:
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="CodeFont" parent="@android:style/TextAppearance.Medium"> <item name="android:layout_width">fill_parent</item> <item name="android:layout_height">wrap_content</item> <item name="android:textColor">#00FF00</item> <item name="android:typeface">monospace</item> </style> </resources>
, style.
<TextView style="@style/CodeFont" android:text="@string/hello" />
 ,           . 
android:layout_span.
, , android:layout_column
<TableLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <TableRow> <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column1" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column2" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column 3" android:textAppearance="?android:attr/textAppearanceMedium"/> </TableRow> <TableRow> <TextView android:id="@+id/textViewSpan" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" span three column" android:layout_span = "3" android:textSize="23sp" android:textAppearance="?android:attr/textAppearanceMedium"/> </TableRow> </TableLayout>



Alternate Layouts
Alternate Layouts - . .
XML :

res/layout-land тАУ landscape UI
res/layout-port тАУ portrait UI
res/lauout-square тАУ square UI

res/lauout .

.

.
:
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="#00FF00" android:typeface="monospace" android:text="@string/hello" />

xml res/values/
:
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="CodeFont" parent="@android:style/TextAppearance.Medium"> <item name="android:layout_width">fill_parent</item> <item name="android:layout_height">wrap_content</item> <item name="android:textColor">#00FF00</item> <item name="android:typeface">monospace</item> </style> </resources>
, style.
<TextView style="@style/CodeFont" android:text="@string/hello" />
, .
android:layout_span.
, , android:layout_column
<TableLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <TableRow> <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column1" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column2" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column 3" android:textAppearance="?android:attr/textAppearanceMedium"/> </TableRow> <TableRow> <TextView android:id="@+id/textViewSpan" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" span three column" android:layout_span = "3" android:textSize="23sp" android:textAppearance="?android:attr/textAppearanceMedium"/> </TableRow> </TableLayout>



Alternate Layouts
Alternate Layouts - . .
XML :

res/layout-land тАУ landscape UI
res/layout-port тАУ portrait UI
res/lauout-square тАУ square UI

res/lauout .

.

.
:
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="#00FF00" android:typeface="monospace" android:text="@string/hello" />

xml res/values/
:
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="CodeFont" parent="@android:style/TextAppearance.Medium"> <item name="android:layout_width">fill_parent</item> <item name="android:layout_height">wrap_content</item> <item name="android:textColor">#00FF00</item> <item name="android:typeface">monospace</item> </style> </resources>
, style.
<TextView style="@style/CodeFont" android:text="@string/hello" />
 ,           . 
android:layout_span.
, , android:layout_column
<TableLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <TableRow> <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column1" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column2" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column 3" android:textAppearance="?android:attr/textAppearanceMedium"/> </TableRow> <TableRow> <TextView android:id="@+id/textViewSpan" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" span three column" android:layout_span = "3" android:textSize="23sp" android:textAppearance="?android:attr/textAppearanceMedium"/> </TableRow> </TableLayout>



Alternate Layouts
Alternate Layouts - . .
XML :

res/layout-land тАУ landscape UI
res/layout-port тАУ portrait UI
res/lauout-square тАУ square UI

res/lauout .

.

.
:
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="#00FF00" android:typeface="monospace" android:text="@string/hello" />

xml res/values/
:
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="CodeFont" parent="@android:style/TextAppearance.Medium"> <item name="android:layout_width">fill_parent</item> <item name="android:layout_height">wrap_content</item> <item name="android:textColor">#00FF00</item> <item name="android:typeface">monospace</item> </style> </resources>
, style.
<TextView style="@style/CodeFont" android:text="@string/hello" />
, .
android:layout_span.
, , android:layout_column
<TableLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <TableRow> <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column1" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column2" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column 3" android:textAppearance="?android:attr/textAppearanceMedium"/> </TableRow> <TableRow> <TextView android:id="@+id/textViewSpan" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" span three column" android:layout_span = "3" android:textSize="23sp" android:textAppearance="?android:attr/textAppearanceMedium"/> </TableRow> </TableLayout>



Alternate Layouts
Alternate Layouts - . .
XML :

res/layout-land тАУ landscape UI
res/layout-port тАУ portrait UI
res/lauout-square тАУ square UI

res/lauout .

.

.
:
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="#00FF00" android:typeface="monospace" android:text="@string/hello" />

xml res/values/
:
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="CodeFont" parent="@android:style/TextAppearance.Medium"> <item name="android:layout_width">fill_parent</item> <item name="android:layout_height">wrap_content</item> <item name="android:textColor">#00FF00</item> <item name="android:typeface">monospace</item> </style> </resources>
, style.
<TextView style="@style/CodeFont" android:text="@string/hello" />
 ,           . 
android:layout_span.
, , android:layout_column
<TableLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <TableRow> <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column1" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column2" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="column 3" android:textAppearance="?android:attr/textAppearanceMedium"/> </TableRow> <TableRow> <TextView android:id="@+id/textViewSpan" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" span three column" android:layout_span = "3" android:textSize="23sp" android:textAppearance="?android:attr/textAppearanceMedium"/> </TableRow> </TableLayout>



Alternate Layouts
Alternate Layouts - . .
XML :

res/layout-land тАУ landscape UI
res/layout-port тАУ portrait UI
res/lauout-square тАУ square UI

res/lauout .

.

.
:
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="#00FF00" android:typeface="monospace" android:text="@string/hello" />

xml res/values/
:
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="CodeFont" parent="@android:style/TextAppearance.Medium"> <item name="android:layout_width">fill_parent</item> <item name="android:layout_height">wrap_content</item> <item name="android:textColor">#00FF00</item> <item name="android:typeface">monospace</item> </style> </resources>
, style.
<TextView style="@style/CodeFont" android:text="@string/hello" />

Source: https://habr.com/ru/post/In181820/


All Articles