常用布局
来源:互联网 发布:为什么淘宝iphone8便宜 编辑:程序博客网 时间:2024/06/10 09:04
1:顶部横向拉动和页面切换布局
<android.support.design.widget.TabLayout
android:id="@+id/tab"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
/>
<android.support.v4.view.ViewPager
android:id="@+id/vp"
android:layout_weight="8"
android:layout_width="match_parent"
android:layout_height="0dp"/>
2,侧拉隐藏fragment布局
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.bwie.yuekaolianxi1.MainActivity">
<RelativeLayout
android:id="@+id/rl"
android:layout_gravity="start"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ff3660">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="180dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@mipmap/ic_launcher"/>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="190dp"
android:layout_marginLeft="20dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="sssss"
android:textSize="25sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="sssss"
android:textSize="25sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="sssss"
android:textSize="25sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="sssss"
android:textSize="25sp"/>
</LinearLayout>
</RelativeLayout>
</android.support.v4.widget.DrawerLayout>
3:底部fragment按钮布局
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
android:id="@+id/fl"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="9"></FrameLayout>
<RadioGroup
android:id="@+id/rg"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<RadioButton
android:id="@+id/but01"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="首页"
android:gravity="center"
android:button="@null"
android:background="#ff3660"/>
<RadioButton
android:id="@+id/but02"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="自选"
android:gravity="center"
android:button="@null"
android:background="#ff0"/>
<RadioButton
android:id="@+id/but03"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="行情"
android:gravity="center"
android:button="@null"
android:background="#eeffee"/>
<RadioButton
android:id="@+id/but04"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="咨询"
android:gravity="center"
android:button="@null"
android:background="#00f"/>
<RadioButton
android:id="@+id/but05"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="交易"
android:gravity="center"
android:button="@null"
android:background="#ff00"/>
</RadioGroup>
</LinearLayout>
4:上拉下拉刷新布局
<com.handmark.pulltorefresh.library.PullToRefreshListView
android:id="@+id/plv"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<android.support.design.widget.TabLayout
android:id="@+id/tab"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
/>
<android.support.v4.view.ViewPager
android:id="@+id/vp"
android:layout_weight="8"
android:layout_width="match_parent"
android:layout_height="0dp"/>
2,侧拉隐藏fragment布局
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.bwie.yuekaolianxi1.MainActivity">
<RelativeLayout
android:id="@+id/rl"
android:layout_gravity="start"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ff3660">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="180dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@mipmap/ic_launcher"/>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="190dp"
android:layout_marginLeft="20dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="sssss"
android:textSize="25sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="sssss"
android:textSize="25sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="sssss"
android:textSize="25sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="sssss"
android:textSize="25sp"/>
</LinearLayout>
</RelativeLayout>
</android.support.v4.widget.DrawerLayout>
3:底部fragment按钮布局
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
android:id="@+id/fl"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="9"></FrameLayout>
<RadioGroup
android:id="@+id/rg"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<RadioButton
android:id="@+id/but01"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="首页"
android:gravity="center"
android:button="@null"
android:background="#ff3660"/>
<RadioButton
android:id="@+id/but02"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="自选"
android:gravity="center"
android:button="@null"
android:background="#ff0"/>
<RadioButton
android:id="@+id/but03"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="行情"
android:gravity="center"
android:button="@null"
android:background="#eeffee"/>
<RadioButton
android:id="@+id/but04"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="咨询"
android:gravity="center"
android:button="@null"
android:background="#00f"/>
<RadioButton
android:id="@+id/but05"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="交易"
android:gravity="center"
android:button="@null"
android:background="#ff00"/>
</RadioGroup>
</LinearLayout>
4:上拉下拉刷新布局
<com.handmark.pulltorefresh.library.PullToRefreshListView
android:id="@+id/plv"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
阅读全文
0 0
- 常用布局
- 常用布局
- 常用布局
- 常用布局
- 常用布局
- 常用布局
- 常用布局
- CSS常用布局实例
- 常用div+css布局
- CSS常用布局实例
- ext 常用布局
- css常用布局网站。
- css常用布局
- css常用布局样式
- css常用布局样式
- Android中的常用布局
- Ext常用布局处理
- android 常用的布局
- iOS 修饰符~ NS_DESIGNATED_INITIALIZER
- aop,ioc的概念
- android NDK 打印16进制字符串
- 阿里云飞天系统
- leetcode题解-36. Valid Sudoku
- 常用布局
- Python路径问题
- 深度学习 神经网络 中文 入门 书籍 课程 推荐 (附 免费 下载 链接)
- oracle闪回操作
- Chrome 62:全面向http发出不安全标签
- 自定义View:实现炫酷的点赞特效(仿即刻)
- echart饼状图上显示百分比
- 697
- 指针就是地址