ListView Project (2)
ListView project ေလးတစ္ခု အပ်င္းေျပ ေရးၾကည္႔ရေအာင္ဗ်ာ ... အပိုင္း ( 2 )
***********************
ဒီအပိုင္းမွာလည္း layout ပိုင္းပဲ ဆက္စဥ္းရေအာင္ပါ။ အခု project က listview အေၾကာင္းဆိုေတာ႔ ListView တစ္ခုပါမယ္။ က်ေနာက္က member ေတြကို အေျခခံ LEVEL 1 အဆင့္၊ အလယ္အလတ္ LEVEL 2 အဆင့္နဲ႔ အဆင့္ျမင့္ LEVEL 3 အဆင့္ရယ္ဆိုျပီး ListView ကို filter စစ္ျပခ်င္ေသးတာဆိုေတာ႔ LEVEL 1,2,3 Button သံုးခု လိုမယ္။ ျပီးေတာ႔ List ထဲကို member တစ္ဦးခ်င္းကို record သြင္း ထည္႔ႏိုင္ဖို႔ + Button တစ္ခုပါမယ္။
ဆိုေတာ႔ အဲ႔ဒါေတြပါေအာင္ ကိုယ္႔စိတ္ၾကိဳက္ layout ရေအာင္ AIDE Designer သံုးျပီး ဆြဲေစေပါ႔။ က်ေနာ္ကေတာ႔ ေအာက္က ပံုထဲကအတိုင္း ခ်ိဳးထားပါတယ္။ က်ေနာ႔ layout ကို သံုးခ်င္ရင္လည္း ေပးထားပါတယ္။ အဲ button အဝိုင္းအတြက္ေတာ႔ drawable xml ဖိုင္ေတြ ေတြ သံုးေပါ႔။ code ပိုင္းေတြ အမ်ားၾကီး ေျပာခ်င္ေသးတာဆိုေတာ႔ Layout ပိုင္းေတာ႔ ခ်န္ထားခဲ႔ပါမယ္။
main.xml
===========
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#2FA21F">
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="horizontal"
android:id="@+id/mainLinearLayout1"
android:padding="10dp">
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:orientation="horizontal"
android:layout_weight="1.0"
android:gravity="center">
<Button
android:layout_height="wrap_content"
android:text="LEVEL 1"
android:layout_width="wrap_content"
android:textColor="#FDFDFD"/>
</LinearLayout>
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:orientation="horizontal"
android:layout_weight="1.0"
android:gravity="center">
<Button
android:layout_height="wrap_content"
android:text="LEVEL 2"
android:layout_width="wrap_content"
android:textColor="#FFFFFF"/>
</LinearLayout>
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:orientation="horizontal"
android:layout_weight="1.0"
android:gravity="center">
<Button
android:layout_height="wrap_content"
android:text="LEVEL 3"
android:layout_width="wrap_content"
android:textColor="#FBFBFB"/>
</LinearLayout>
</LinearLayout>
<ListView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_below="@id/mainLinearLayout1"/>
<Button
android:layout_height="55dp"
android:text="+"
android:layout_width="55dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_margin="10dp"
android:background="@drawable/circle_button"
android:textColor="#FFFFFF"
android:textSize="20sp"/>
</RelativeLayout>
-----------------------------------------
အပိုင္း ( 3 ) ေမွ်ာ္ .... :)
ကိုမ်ိဳး
AIDE Android Lessons And Project Group
မွကူးယူတင္ထားပါသည္
#mkk_ListView
Comments
Post a Comment
Thank,s for ...