Xml version= 0" encoding="utf-8"
bet 1/2 Sana 31.05.2022 Hajmi 178,08 Kb. #622122
Bog'liq
TopshiriqRadiobutton bilan ishlash d479e858d60fa41320240479b3339172
Topshiriq Radiobutton bilan ishlash
Har doimgidek biz Android studioni ishga tushirib bizga kerakli dizayni hosil qilib olamiz va
Men bu ishlarni ko’rsatib o’tmadim
Siz bu yerda tayyorlangan dizayni ko’ishingiz mumkin endi esa bu dizaynni xml kodini ko’rsataman.
xml version="1.0" encoding="utf-8" ?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:orientation="vertical" >
<TextView
android:id="@+id/current_pick"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#AC26C3"
android:gravity="center"
android:text="@string/current_pick"
android:textColor="#ffffff"
/>
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="@+id/textViewRed"
android:layout_width="match_parent"
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_weight="1"
android:background="#ff0000"
android:text="@string/color_red"
android:textColor="#660000" />
<TextView
android:id="@+id/textViewGreen"
android:layout_width="match_parent"
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_weight="1"
android:background="#00ff00"
android:text="@string/color_green"
android:textColor="#006600" />
<TextView
android:id="@+id/textViewBlue"
android:layout_width="match_parent"
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_weight="1"
android:background="#0000ff"
android:text="@string/color_blue"
android:textColor="#000066" />
<TextView
android:id="@+id/textViewGray"
android:layout_width="match_parent"
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_weight="1"
android:text="@string/color_gray" />
LinearLayout >
<RadioGroup
android:id="@+id/radioGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#333333"
android:orientation="horizontal" >
<RadioButton
android:id="@+id/radio_red"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_weight="1" />
<RadioButton
android:id="@+id/radio_blue"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_weight="1" />
<RadioButton
android:id="@+id/radio_green"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_weight="1"
android:checked="true" />
<RadioButton
android:id="@+id/radio_gray"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_weight="1"
/>
RadioGroup >
LinearLayout >
Biz radiobuttonlarga id berib chiqilgan
Biz java kodga o’tamiz
Do'stlaringiz bilan baham: