【问题标题】:Android Navigation Tab LayoutAndroid 导航选项卡布局
【发布时间】:2014-05-19 11:09:33
【问题描述】:

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

这是我的自定义布局 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 layout tabs navigation


    【解决方案1】:

    尝试使用android:padding 属性。

    【讨论】:

    • 这应该是评论,而不是答案。
    猜你喜欢
    • 2020-07-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多