Code Bye

想用RadioGroup做底部导航页,怎么样在上面加一条线

为了加那条线,本人加了了一个imageview,,但是会有缝隙。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
    android:layout_height="match_parent">
    <RadioGroup
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:orientation="horizontal"
        android:id="@+id/radiogroup">
        <RadioButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:drawableTop="@drawable/radiobutton_home_selector"
            android:textColor="@drawable/radiobutoon_home_text_selector"
            android:layout_marginLeft="20dp"
            android:textSize="15sp"
            android:gravity="center"
            android:text="@string/home"
            android:button="@null"/>
        <RadioButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:drawableTop="@drawable/raidobutton_girdviw_selector"
            android:textColor="@drawable/radiobutton_girdview_text_selector"
            android:text="@string/girdview"
            android:button="@null"
            android:gravity="center"
            android:textSize="15sp"
            />
        <RadioButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:drawableTop="@drawable/radionbutton_internet_selector"
            android:textColor="@drawable/radiobutton_internet_text_selector"
            android:text="@string/internet"
            android:button="@null"
            android:gravity="center"
            android:textSize="15sp"
            />
    </RadioGroup>
    <ImageView
        android:layout_width="match_parent"
        android:layout_height="2dp"
        android:id="@+id/imageView"
        android:background="@color/colorAccent"
        android:layout_above="@+id/radiogroup"
        android:layout_marginBottom="10dp"
        android:layout_centerHorizontal="true" />
</RelativeLayout>


新手求指点~~

解决方案

20

外层的布局有margin或padding

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明想用RadioGroup做底部导航页,怎么样在上面加一条线