Android导航选项卡布局

Android导航选项卡布局,android,layout,tabs,navigation,Android,Layout,Tabs,Navigation,我为导航选项卡创建自定义视图。没关系。但是,这种布局有两个问题:图标出现在中心位置上方一点,文本覆盖在导航指示器上。导航选项卡如下所示: 以下是我的自定义布局xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

我为导航选项卡创建自定义视图。没关系。但是,这种布局有两个问题:图标出现在中心位置上方一点,文本覆盖在导航指示器上。导航选项卡如下所示:

以下是我的自定义布局xml:

 <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/navigation_tab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@android:color/transparent"
        android:src="@drawable/ic_search" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Search"
        android:textSize="12sp" />

</LinearLayout>


尝试使用
android:padding
属性。

这应该是一个注释,而不是答案。