是一个拨号盘的界面, 整个界面是一个 拨号历史记录的list列表,在列表上覆盖了一个拨号盘,拨号盘可以隐藏, 可是在点击拨号盘每隔按钮之间很小的空隙会响应到下面被覆盖的list列表item click事件. 求解....<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" 
android:layout_weight="1"
android:layout_width="match_parent" 
android:layout_height="match_parent">

   <fragment android:name="com.android.contacts.calllog.CallLogFragment" 
    android:id="@+id/calllog" 
android:layout_width="match_parent" 
android:layout_height="match_parent"/>
    <!-- Keypad section -->
    <include layout="@layout/t9_dialpad_px" 
   android:id="@+id/dialpad"/>
  </FrameLayout>
这是部分的布局

解决方案 »

  1.   


    拨号盘t9_dialpad_px.xml 的布局<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    
    android:layout_width="fill_parent"
    android:layout_height="240dip"
    android:orientation="vertical"
    android:layout_gravity="bottom"
    android:background="@drawable/dial_background_px"
    >
    <TableLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/dialpad"
        android:layout_width="match_parent"
        android:layout_height="240dip"
        android:layout_weight="1"
        android:layout_gravity="center_horizontal"
        android:layout_marginTop="@dimen/dialpad_vertical_margin"
        android:paddingBottom="5dip"
        android:paddingTop="5dip"
        android:background="#FFF">

        <TableRow
             android:layout_height="0px"
             android:layout_weight="1">
            <ImageButton android:id="@+id/one" style="@style/DialpadButtonStylePX"
                android:src="@drawable/dial_num_1_px"
                android:layout_weight="1"
    android:layout_marginLeft="5dip"
    android:layout_marginRight="5dip"
                android:contentDescription="@string/description_image_button_one" />
            <ImageButton android:id="@+id/two" style="@style/DialpadButtonStylePX"
                android:src="@drawable/dial_num_2_px"
                android:layout_weight="1"
    android:layout_marginLeft="5dip"
    android:layout_marginRight="5dip"
                android:contentDescription="@string/description_image_button_two" />
            <ImageButton android:id="@+id/three" style="@style/DialpadButtonStylePX"
                android:src="@drawable/dial_num_3_px"
                android:layout_weight="1"
    android:layout_marginLeft="5dip"
    android:layout_marginRight="5dip"
                android:contentDescription="@string/description_image_button_three" />
        </TableRow>

        <TableRow
             android:layout_height="0px"
             android:layout_weight="1">
            <ImageButton android:id="@+id/four" style="@style/DialpadButtonStylePX"
                android:src="@drawable/dial_num_4_px"
                android:layout_weight="1"
                android:contentDescription="@string/description_image_button_four" />
            <ImageButton android:id="@+id/five" style="@style/DialpadButtonStylePX"
                android:src="@drawable/dial_num_5_px"
                android:layout_weight="1"
                android:contentDescription="@string/description_image_button_five" />
            <ImageButton android:id="@+id/six" style="@style/DialpadButtonStylePX"
                android:src="@drawable/dial_num_6_px"
                android:layout_weight="1"
                android:contentDescription="@string/description_image_button_six" />
        </TableRow>

        <TableRow
             android:layout_height="0px"
             android:layout_weight="1">
            <ImageButton android:id="@+id/seven" style="@style/DialpadButtonStylePX"
                android:src="@drawable/dial_num_7_px"
                android:layout_weight="1"
                android:contentDescription="@string/description_image_button_seven" />
            <ImageButton android:id="@+id/eight" style="@style/DialpadButtonStylePX"
                android:src="@drawable/dial_num_8_px"
                android:layout_weight="1"
                android:contentDescription="@string/description_image_button_eight" />
            <ImageButton android:id="@+id/nine" style="@style/DialpadButtonStylePX"
                android:src="@drawable/dial_num_9_px"
                android:layout_weight="1"
                android:contentDescription="@string/description_image_button_nine" />
        </TableRow>

        <TableRow
             android:layout_height="0px"
             android:layout_weight="1">
            <ImageButton android:id="@+id/star" style="@style/DialpadButtonStylePX"
                android:src="@drawable/dial_num_star_px"
                android:layout_weight="1"
                android:contentDescription="@string/description_image_button_star" />
            <ImageButton android:id="@+id/zero" style="@style/DialpadButtonStylePX"
                android:src="@drawable/dial_num_0_px"
                android:layout_weight="1"
                android:contentDescription="@string/description_image_button_zero" />
            <ImageButton android:id="@+id/pound" style="@style/DialpadButtonStylePX"
                android:src="@drawable/dial_num_pound_px"
                android:layout_weight="1"
                android:contentDescription="@string/description_image_button_pound" />
        </TableRow>
    </TableLayout>

    </LinearLayout>
      

  2.   

    对啊,FrameLayout是单帧布局,在其目录下的子目录,逐个将前面的覆盖,即你第一个XML中的fragment被 include 里面的内容给覆盖,可以换一个他们两个的位置。