.


:




:

































 

 

 

 


. .




(Button, SmallButton) . , ( ). TextView , , ompoundButton. CompoundButton :

- CheckBox (, ) , , , False/True, /, /, / .), , False, ( ☑) True, ,

- ToggleButton( ) , , ( , On Off, Text on ( android:textOn) Text off ( android:textOff) ), , , ( LED-),

- RadioButton ( ), RadioButton RadioGroup ( , , TextView), , RadioGroup, .

Button ImageButton (android.widget.ImageButton), (Image).

c (Button) (SmallButton) Widgets, . Design Palette. Layouts, View Text Fields.

(Button) (SmallButton). :

1) - ,

2) ( ),

3) ,

4) SmallButton .

 

.

1. Button Palette . . Button, , :

<Button

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="New Button"

android:id="@+id/button"

android:layout_centerVertical="true"

android:layout_alignParentRight="true"

android:layout_alignParentEnd="true"

android:layout_marginRight="223dp"

android:layout_marginEnd="223dp" />

. :

<Button

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="New Button"

android:id="@+id/button"

android:layout_alignParentBottom="true"

android:layout_alignParentLeft="true"

android:layout_alignParentStart="true" />

2. background. background. Resourses Project, System, Color . . - RGB ( , ). , 255 Red, Green 0 Blue. , # - 16- FFFF00, 0 256 16- (.2.3).

OK: 1) , , (.2.4), 2) ( ) :

android:background="#ffffff00">

 

.2.3.

.2.4.

3. , , Text. . (android:text=""). Color ARGB 255 lpha- Red. :

android:textColor="#ffff0000" />

4. SmallButton - ( ARGB, : 255-0-0-0), - () ( ARGB, : 255-255-255-255) C.

.2.5.

:

<Button

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text=""

android:id="@+id/button"

android:layout_alignParentBottom="true"

android:layout_alignParentLeft="true"

android:layout_alignParentStart="true"

android:background="#ffffff00"

android:textColor="#ffff0000" />

 

.2.5.

:

<Button

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text=""

android:id="@+id/button"

android:layout_alignParentBottom="true"

android:layout_alignParentLeft="true"

android:layout_alignParentStart="true"

android:background="#ffffff00"

android:textColor="#ffff0000" />

<Button

style="?android:attr/buttonStyleSmall"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text=""

android:id="@+id/button2"

android:layout_alignParentBottom="true"

android:layout_alignParentRight="true"

android:layout_alignParentEnd="true"

android:background="#ff000000"

android:textColor="#ffffffff" />

, XML- Palette Properties. activity_main.xml , . . activity_main.xml .





:


: 2016-11-24; !; : 743 |


:

:

, , .
==> ...

1888 - | 1524 -


© 2015-2024 lektsii.org - -

: 0.018 .