Android 顶部悬停
来源:互联网 发布:sap84软件购买 编辑:程序博客网 时间:2024/04/28 16:23
效果主要靠布局来实现的,主要使用了CoordinatorLayout+AppBarLayout+CollapsingToolbarLayout
<?xml version="1.0" encoding="utf-8"?><android.support.design.widget.CoordinatorLayout 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:orientation="vertical"> <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/AppTheme.AppBarOverlay"> <android.support.design.widget.CollapsingToolbarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:fitsSystemWindows="true" app:contentScrim="?attr/colorPrimary" app:layout_collapseMode="parallax" app:layout_collapseParallaxMultiplier="0.7" app:layout_scrollFlags="scroll|exitUntilCollapsed"> <ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/wenyi" /> </android.support.design.widget.CollapsingToolbarLayout> <!--悬停部分--> <android.support.design.widget.TabLayout android:id="@+id/tablayout" android:layout_width="match_parent" android:layout_height="wrap_content"> </android.support.design.widget.TabLayout> </android.support.design.widget.AppBarLayout> <android.support.v4.widget.NestedScrollView android:layout_width="match_parent" android:layout_height="wrap_content" app:layout_behavior="@string/appbar_scrolling_view_behavior"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/str" android:textSize="20sp" /> </android.support.v4.widget.NestedScrollView></android.support.design.widget.CoordinatorLayout>
Activity里面主要就是对TabLayout 的设置
private TabLayout mTabLayout; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_coor); mTabLayout= (TabLayout) findViewById(R.id.tablayout); mTabLayout.addTab(mTabLayout.newTab().setText("分类")); mTabLayout.addTab(mTabLayout.newTab().setText("排序")); mTabLayout.addTab(mTabLayout.newTab().setText("价格")); mTabLayout.setTabTextColors(Color.BLACK,Color.RED); mTabLayout.setSelectedTabIndicatorColor(Color.RED); mTabLayout.setBackgroundColor(Color.GREEN); }
0 0
- Android 顶部悬停
- 【Android自定义控件】布局悬停在顶部
- Android视图的顶部悬停的实现
- Android开发滑动到顶部悬停效果
- android 顶部悬停折叠CoordinatorLayout,AppBarLayout
- 两个Layout一个属性快速实现Android滑动顶部悬停
- android顶部悬停效果(仅用ListView实现)
- scrollview顶部悬停和隐藏
- [Android实例] 仿美团app,浮动layout滑动到顶部悬停效果
- collectionView 如何让headerView悬停在顶部
- ListView(头部+下拉筛选+顶部悬停)
- ScrollView向上滑动滑动到顶部悬停
- listview添加标题并且悬停顶部
- 下拉滚动,导航条悬停在顶部
- 【UI特效】FrameLayout实现ListView顶部悬停效果
- 仿美团app,浮动layout滑动到顶部悬停效果
- 仿美团app,浮动layout滑动到顶部悬停效果
- 实现类似网易邮箱的顶部工具栏的悬停效果
- 对于混淆C#代码,你们有啥建议吗?
- 批处理隐藏运行的11种思路
- JS组件系列——表格组件神器:bootstrap table(一)
- 一个漂亮的干货集中营客户端的生成,集合了干货api的大部分功能
- hadoop的安装
- Android 顶部悬停
- 建立 索引常用的规则
- 阿拉伯语状态下TextView如何从右往左显示
- enjoy summer the many year
- 矩阵求逆
- 微信小程序-wx:key理解
- JS组件系列——表格组件神器:bootstrap table(二)
- Android 7.0 Audio :通话中的音频调用接口
- 经典算法(4):K最近邻算法(KNN)