Reputation: 19966
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:id="@+id/li"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="50dip"
android:orientation="horizontal"
android:background="@drawable/title_bg">
<ImageButton
android:id="@+id/invitebackButton"
android:layout_width="wrap_content"
android:background="@android:color/transparent"
android:src="@drawable/back_button"
android:layout_height="wrap_content"
android:layout_marginLeft="5dip" />
<TextView
android:id="@+id/invitation_sinatitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/invite_myfriends"
android:layout_marginLeft="70dip" />
</LinearLayout>
<LinearLayout android:id="@+id/buttonLayout"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" >
<Button android:id="@+id/invite_mobile_Button"
android:focusable="true"
android:clickable="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:text="@string/invite_my_friends" />
<Button android:id="@+id/clean_Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="30dip"
android:layout_margin="2dp"
android:text="@string/invite_clean" />
</LinearLayout>
<ExpandableListView
android:id="@+id/mobileinvitelist"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginTop="10dip"
android:layout_below="@id/li" />
</RelativeLayout>
you see in my layout have invite_mobile_Button and clear_button,but when I run my app,the two button not get focus and click. Can you give me some clue?
Upvotes: 1
Views: 5664
Reputation: 4842
You set android:layout_height="fill_parent"
so your ExpandableListView fills in all the window, as Akki comments. That's why your buttons can't be clicked, because the ExpandableListView overlays them.
Try to change it to android:layout_height="wrap_content"
or position the ExpandableListView and the LinearLayout(@+id/buttonLayout) explicitly, i.e., (@+id/buttonLayout) is set below (@+id/li) and the ExpandableListView is set below (@+id/buttonLayout), so the layout could display correctly.
Upvotes: 2