准确布局
来源:互联网 发布:caffe top bottom 编辑:程序博客网 时间:2024/04/28 20:43
activity_main
<?xml version="1.0" encoding="utf-8"?>
<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:id="@+id/drawLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--侧拉的布局-->
<RelativeLayout
android:id="@+id/rel"
android:background="#0ff"
android:layout_gravity="start"
android:layout_width="match_parent"
android:layout_height="match_parent">
<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="match_parent"
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:orientation="horizontal"
android:layout_weight="1">
<RadioButton
android:id="@+id/rb1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:button="@null"
android:layout_weight="1"
android:checked="true"
android:textColor="#fff"
android:background="@drawable/selector"
android:text="首页"
android:gravity="center"
android:textSize="25sp"/>
<RadioButton
android:id="@+id/rb2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:button="@null"
android:layout_weight="1"
android:textColor="#fff"
android:background="@drawable/selector"
android:text="发现"
android:gravity="center"
android:textSize="25sp"/>
<RadioButton
android:id="@+id/rb3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:button="@null"
android:gravity="center"
android:textColor="#fff"
android:background="@drawable/selector"
android:text="下载"
android:textSize="25sp" />
<RadioButton
android:id="@+id/rb4"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:button="@null"
android:layout_weight="1"
android:textColor="#fff"
android:background="@drawable/selector"
android:text="我的"
android:gravity="center"
android:textSize="25sp"/>
</RadioGroup>
</LinearLayout>
</android.support.v4.widget.DrawerLayout>
blankfragment
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<com.handmark.pulltorefresh.library.PullToRefreshListView
android:id="@+id/plv"
android:layout_width="match_parent"
android:layout_height="match_parent">
</com.handmark.pulltorefresh.library.PullToRefreshListView>
</LinearLayout>
fragment01
<?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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.8"
android:orientation="horizontal">
<android.support.design.widget.TabLayout
android:id="@+id/tab"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="9">
</android.support.design.widget.TabLayout>
<SearchView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"></SearchView>
</LinearLayout>
<android.support.v4.view.ViewPager
android:id="@+id/vp"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="9.2">
</android.support.v4.view.ViewPager>
</LinearLayout>
fragment02
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="2"
android:textSize="50sp"/>
</LinearLayout>
fragment03
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="3"
android:textSize="50sp"/>
</LinearLayout>
fragment04
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="4"
android:textSize="50sp"/>
</LinearLayout>
headerbanner
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<com.youth.banner.Banner
android:id="@+id/bannerContainer"
android:layout_width="match_parent"
android:layout_height="120dp"></com.youth.banner.Banner>
</LinearLayout>
list_item
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/img"
android:layout_width="80dp"
android:layout_height="50dp"/>
<TextView
android:id="@+id/tv1"
android:layout_marginLeft="100dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="111"/>
<TextView
android:id="@+id/tv2"
android:layout_marginLeft="100dp"
android:layout_marginTop="30dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="111"/>
</RelativeLayout>
- 准确布局
- 准确布局
- 通过自定义键盘布局准确获取软键盘是否弹出
- 如何准确获取xib创建的autolayout布局下的view的真实frame
- 准确Fragment
- 准确Bean
- 准确HttpUrlConnection
- 准确MainActivity
- 准确MApp
- 准确NetUtils
- 准确NetUtils
- 准确MApp
- 准确MainActivity
- 准确HttpUrlConnection
- 准确Bean
- 准确Fragment
- 关于imageview 不让背景图片自动拉伸填充 imageview 以及布局参数的设置的小结(自己试验的可能不怎么准确)
- 准确定义 Web2.0
- 关于使用vue 的resource插件用post请求数据时一直是options的解决方案
- H5多图片压缩加水印上传
- 序列化与反序列化
- CentOS6.9开启sshd服务
- Java
- 准确布局
- using 三种使用方式
- 10分钟掌握XML、JSON及其解析
- 清除缓存的工具类
- hdu 6186 CS Course (前后缀求区间问题)
- 页面平均分成4部分
- LeetCode-693. Binary Number with Alternating Bits
- 一次经验记录--Linux环境安装vue.js
- 关于swiper滑动时a标签误触,导致跳转的解决办法