我试图实现如link中所示的页面。任何人都可以请帮助我如何得到它。Android折叠与可滑动标签的动作栏
2
A
回答
4
https://github.com/kaedea/Andriod-Seamless-ViewPager-Header
我提到这个例子的工作罚款me.please试试这个肯定ü会得到。
-1
Try this one
<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/swipeContainer"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/tabanim_maincontent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<android.support.design.widget.AppBarLayout
android:id="@+id/tabanim_appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_collapseMode="parallax"
app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed">
<!-- View that will be hidden when video goes fullscreen -->
<RelativeLayout
android:id="@+id/nonVideoLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white">
// your view
</RelativeLayout>
</RelativeLayout>
/***
Here You can add custom layout
**/
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
app:tabIndicatorColor="@android:color/holo_blue_light"
app:tabSelectedTextColor="@color/black"
app:tabTextColor="@color/black" />
</android.support.design.widget.AppBarLayout>
<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" />
</android.support.design.widget.CoordinatorLayout>
</android.support.v4.widget.SwipeRefreshLayout>
0
对于展开和折叠工具栏(不要紧,如果它有标签或没有):
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
</android.support.design.widget.CoordinatorLayout>
0
试试这个XML:在视图寻呼机你可以刷卡按tablayout选择的选项卡。
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.CoordinatorLayout
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_addProfile"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:layout_margin="@dimen/_5sdp"
app:backgroundTint="@color/colorPrimary"
app:elevation="@dimen/_2sdp"
app:fabSize="normal"
android:visibility="gone"
app:rippleColor="@color/textPrimary"
app:srcCompat="@drawable/ic_vector_plus_white"
app:useCompatPadding="true" />
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary"
app:layout_scrollFlags="scroll|snap"
app:titleEnabled="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_collapseMode="parallax">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/dv_coverImage"
android:layout_width="match_parent"
android:layout_height="@dimen/_100sdp"
android:scaleType="centerCrop"
android:alpha="0.85"
android:tint="@color/black_translucent"
android:src="@drawable/bg_profile" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_50sdp"
android:weightSum="1">
<ImageView
android:id="@+id/dv_profile_pic"
android:layout_width="@dimen/_80sdp"
android:layout_height="@dimen/_80sdp"
android:layout_margin="@dimen/_10sdp" />
</FrameLayout>
</FrameLayout>
</LinearLayout>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@android:color/transparent"
app:layout_collapseMode="parallax"
app:navigationIcon="@drawable/ic_menu_white"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
</android.support.design.widget.CollapsingToolbarLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:orientation="vertical">
<android.support.design.widget.TabLayout
android:id="@+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_gravity="bottom"
android:background="?attr/selectableItemBackground"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:layout_collapseMode="pin"
app:tabGravity="fill"
app:tabIndicatorColor="@color/white"
app:tabMode="fixed"
app:tabSelectedTextColor="@color/white"
app:tabTextAppearance="@style/AppTheme.ProfileTab"
app:tabTextColor="@color/darkGreen" />
</LinearLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:id="@+id/nestedScrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="fill_vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
<include layout="@layout/view_progress_view" />
</FrameLayout>
+0
你能详细告诉我关于“view_progress_view”吗? –
+0
这是我为个人使用而创建的progressview,您可以忽略它。删除该行不会影响其他代码 –
1
试试这个库,无缝viewpager https://github.com/kaedea/Andriod-Seamless-ViewPager-Header
相关问题
- 1. 优化滑动/可折叠侧边栏
- 2. Android可折叠工具栏不工作
- 3. 可折叠/滑动“托盘”(DIV)
- 4. Android ActionBar:可折叠的搜索查看与动作按钮
- 5. 标签折叠
- 6. Android L - 重叠操作栏的滑动菜单
- 7. jQuery - 动画可折叠DIV,向上滑动?
- 8. Android的标签布局与滑动浏览次数隐藏标题栏
- 9. android-如何在自定义操作栏后移动滑动标签
- 10. ViewPager与Headerview和可折叠工具栏
- 11. BottomSheetDialog与可折叠工具栏
- 12. HTML单选按钮折叠和滑动
- 13. jQuery折叠隐藏不活动滑块
- 14. 滑动滑块不工作jQuery标签
- 15. 动作条标签内的滑动标签
- 16. 使导航栏可折叠
- 17. 折叠工具栏和滚动
- 18. 滚动时工具栏不能折叠
- 19. JQuery可折叠标签问题?
- 20. 滑动标签条的外观Android
- 21. android中viewpager滑动的嵌套标签?
- 22. Android中的视差滚动/折叠工具栏
- 23. Android DrawerLayout不滑动操作栏
- 24. 折叠标签 - 跳到打开标签
- 25. 铬像可折叠的搜索栏(在Java中 - 摆动)
- 26. Android滑动,使用ViewPager没有标签
- 27. Android滑动标签,Fragment_Collection_Object错误
- 28. 添加滑动的页面与在Android中的标签刷卡
- 29. Bootstrap折叠不会自动折叠
- 30. Xamarin形成Android工具栏以在滚动时展开/折叠
我猜不使用折叠工具栏它不能展开和隐藏工具栏 – Rahul