【问题标题】:Can I change the position of swipeable tabs in android?我可以更改 android 中可滑动标签的位置吗?
【发布时间】:2015-07-10 12:33:03
【问题描述】:

我是 android 新手,所以请建议我如何执行以下操作。我需要一个标签视图上方的文本框,我需要为其定位标签视图。在网上学习了一点后,我使用了 ViewPager。任何人都可以建议我得到我需要的东西吗? 我已为我希望在活动上创建的内容附加了一张图片。

https://drive.google.com/open?id=0B4YOVOcFR_ChVzVoekJQbjZud3c

【问题讨论】:

标签: android tabs positioning


【解决方案1】:

我认为你可以同时使用搜索视图、tablayout 和视图分页器

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".SearchViewActivity" >

<SearchView
    android:id="@+id/searchView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true" >
</SearchView>


<android.support.design.widget.TabLayout
        android:id="@+id/tabs"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

<android.support.v4.view.ViewPager
    android:id="@+id/viewpager"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</RelativeLayout>

你可以看看这些链接

https://github.com/chrisbanes/cheesesquare/blob/master/app/src/main/res/layout/include_list_viewpager.xml

https://looksok.wordpress.com/2013/06/15/android-searchview-tutorial-edittext-with-phone-contacts-search-and-autosuggestion/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-05
    • 1970-01-01
    • 2019-08-07
    • 2018-06-26
    • 2015-03-03
    • 1970-01-01
    相关资源
    最近更新 更多