Android: Jednoduché prvky GUI

Z MiS
(Rozdíly mezi verzemi)
Přejít na: navigace, hledání
Spravce (diskuse | příspěvky)
(Osamostatnění stránky)

Aktuální verze z 25. 6. 2015, 10:09


Obsah

TextView

Button

XML atributy

ImageView, ImageButton

XML atributy
<ImageButton android:src="@drawable/obrazek" />
Resources res = getResources();
Drawable img = res.getDrawable(R.drawable.cross);
ibt.setImageDrawable(img);

EditText

XML atributy
Metody
EditText et = (EditText) findviewbyid(R.id.txt);
Editable str = txt.getText();  
Toast toast = Toast.makeText(getApplicationContext(), str, Toast.LENGTH_LONG);
toast.show();  

AutoCompleteTextView

CheckBox

XML atributy
android:id
Metody
isChecked()
setChecked()
toggle()

RadioButton

RadioGroup

XML atributy
android:id (viz dále)
Metody
getCheckedRadioButtonId()

AnalogClock

DigitalClock

Metody
getText()

Switch

Související stránky

Osobní nástroje
Jmenné prostory
Varianty
Akce
Výuka
Navigace
Nástroje