<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >
        
        <ImageView 
            android:id="@+id/iv_intro"
            style="@style/fill"
            android:background="@drawable/home_intro"
            android:scaleType="fitXY"/>
                <RelativeLayout
            android:id="@+id/home_tab_rlyout"
            android:layout_width="fill_parent"
            android:layout_height="@dimen/header_height"
            android:background="@drawable/header_bar_bg" >            <LinearLayout
                android:id="@+id/ll_left"
                style="@style/wrap"
                android:background="@drawable/header_btn_bg"
                android:clickable="false"
                android:gravity="center"
                android:orientation="horizontal" >                <TextView
                    android:id="@+id/tv_left"
                    style="@style/white16"
                    android:layout_centerVertical="true"
                    android:layout_marginLeft="10dip"
                    android:layout_marginRight="10dip"
                    android:text="租房帮"
                    android:textSize="18.0sp"
            android:textStyle="bold" 
                    android:textColor="@android:color/white" />                <ImageView
                    style="@style/wrap"
                    android:background="@drawable/header_divider"
                    />
            </LinearLayout><!--            <LinearLayout-->
<!--                android:layout_width="fill_parent"-->
<!--                android:layout_height="wrap_content"-->
<!--                android:layout_centerInParent="true">--><!--                <TextView -->
<!--                    style="@style/wrap"-->
<!--                    android:text="中间"-->
<!--                    android:layout_centerInParent="true"-->
<!--                    android:layout_toRightOf="@+id/ll_left"-->
<!--                    android:layout_toLeftOf="@+id/ll_right"/>-->
                
                
                <com.soufun.zf.view.SlipSwitchView
                    android:id="@+id/ssv_switch"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_toRightOf="@+id/ll_left"
                    android:layout_toLeftOf="@+id/ll_right"
                    android:layout_centerInParent="true"
                     />
<!--            </LinearLayout>-->            <LinearLayout
                android:id="@+id/ll_right"
                style="@style/wrap"
                android:layout_alignParentRight="true"
                android:background="@drawable/header_btn_bg"
                android:clickable="true"
                android:gravity="center" >                <ImageView
                    style="@style/wrap"
                    android:background="@drawable/header_divider" />                <TextView
                    android:id="@+id/tv_right"
                    style="@style/white16"
                    android:layout_marginLeft="10dip"
                    android:layout_marginRight="10dip"
                    
                    android:textSize="18.0sp"
            android:textStyle="bold" 
                    android:text="搜索" />
            </LinearLayout>
        </RelativeLayout>        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.0"
            android:visibility="gone" />        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="0.0dip"
            android:layout_weight="1.0" />
    </LinearLayout></TabHost>SlipSwitchView是自定义的空间但是怎么设置其在中间的属性都不起作用,来点具体的

解决方案 »

  1.   

    在代码里的onmatch等方法中设置
      

  2.   

    SlipSwitchView 继承于什么类?
      

  3.   

    显示的是什么样?
    截张图看一下
    fill_parent是不是有问题?
                    <com.soufun.zf.view.SlipSwitchView
                        android:id="@+id/ssv_switch"
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent"

                        android:layout_toRightOf="@+id/ll_left"
                        android:layout_toLeftOf="@+id/ll_right"
                        android:layout_centerInParent="true"
                         />
      

  4.   

     <ImageView 
                android:id="@+id/iv_intro"
                style="@style/fill"
                android:background="@drawable/home_intro"
                android:scaleType="fitXY"/>
    这个是不是全屏的
      

  5.   

    我不设置margin属性他一直在一个布局的左上方。