Android布局中实现圆角边框
来源:互联网 发布:vscode golang 格式化 编辑:程序博客网 时间:2024/06/04 18:42
项目结构
解析图片
每个红色正方形代表一个linklayout
每个红色圈圈代表一个imageview
每个绿色圈圈代表一个textview
他们包含关系如下
bg_boder.xml
- <?xml version="1.0" encoding="utf-8"?>
- <shape xmlns:android="http://schemas.android.com/apk/res/android">
- <!--背景色,我这里是白色-->
- <solid android:color="#FFFFFF" />
- <!--圆角处理-->
- <corners android:topLeftRadius="10dp"
- android:topRightRadius="10dp"
- android:bottomRightRadius="10dp"
- android:bottomLeftRadius="10dp"/>
- </shape>
- <?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:background="#E1E0DE"
- android:orientation="vertical" >
- <TextView
- android:id="@+id/textView1"
- android:layout_width="match_parent"
- android:layout_height="50dp"
- android:background="#2B3439"
- android:gravity="center"
- android:text="发现"
- android:textColor="#FFFFFF"
- android:textSize="20sp" />
- <LinearLayout
- android:id="@+id/test_login_div"
- android:layout_width="fill_parent"
- android:layout_height="50dp"
- android:layout_margin="10dp"
- android:background="@drawable/bg_boder"
- android:gravity="center_vertical"
- android:padding="10dp" >
- <ImageView
- android:id="@+id/test_imageView1"
- android:layout_width="25sp"
- android:layout_height="25sp"
- android:src="@drawable/friend" />
- <TextView
- android:id="@+id/test_textView2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="14dp"
- android:text="朋友圈"
- android:textColor="#000"
- android:textSize="18sp" />
- </LinearLayout>
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="101dp"
- android:layout_margin="10dp"
- android:background="@drawable/bg_boder"
- android:orientation="vertical"
- android:padding="10dp" >
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="50dp" >
- <ImageView
- android:layout_width="25sp"
- android:layout_height="25sp"
- android:src="@drawable/ok" />
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="14dp"
- android:text="扫一扫"
- android:textColor="#000"
- android:textSize="18sp" />
- </LinearLayout>
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="50dp"
- android:layout_centerVertical="true" >
- <ImageView
- android:layout_width="25sp"
- android:layout_height="25sp"
- android:src="@drawable/rock" />
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="14dp"
- android:text="摇一摇"
- android:textColor="#000"
- android:textSize="18sp" />
- </LinearLayout>
- </LinearLayout>
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="101dp"
- android:layout_margin="10dp"
- android:background="@drawable/bg_boder"
- android:orientation="vertical"
- android:padding="10dp" >
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="50dp" >
- <ImageView
- android:layout_width="25sp"
- android:layout_height="25sp"
- android:src="@drawable/people" />
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="14dp"
- android:text="附近的人"
- android:textColor="#000"
- android:textSize="18sp" />
- </LinearLayout>
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="50dp"
- android:layout_centerVertical="true" >
- <ImageView
- android:layout_width="25sp"
- android:layout_height="25sp"
- android:src="@drawable/bottle" />
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="14dp"
- android:text="漂流瓶"
- android:textColor="#000"
- android:textSize="18sp" />
- </LinearLayout>
- </LinearLayout>
- <LinearLayout
- android:id="@+id/login_div"
- android:layout_width="fill_parent"
- android:layout_height="50dp"
- android:layout_margin="10dp"
- android:background="@drawable/bg_boder"
- android:gravity="center_vertical"
- android:padding="10dp" >
- <ImageView
- android:id="@+id/imageView1"
- android:layout_width="25sp"
- android:layout_height="25sp"
- android:src="@drawable/game_center" />
- <TextView
- android:id="@+id/textView2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="14dp"
- android:text="游戏中心"
- android:textColor="#000"
- android:textSize="18sp" />
- </LinearLayout>
- </LinearLayout>
Android Studio换个屏幕
0 0
- Android布局中实现圆角边框
- Android布局中实现圆角边框
- Android布局中实现圆角边框
- Android布局中实现圆角边框
- Android布局中实现圆角边框
- Android布局中实现圆角边框
- Android布局中实现圆角边框
- Android布局中实现圆角边框
- Android布局中实现圆角边框
- Android布局中实现圆角边框
- Android布局中实现圆角边框
- Android布局中实现圆角边框
- 【Android】Android布局中实现圆角边框
- 【Android】Android布局中实现圆角边框
- 【Android】Android布局中实现圆角边框
- 【Android】Android布局中实现圆角边框
- 【Android】Android布局中实现圆角边框
- Android布局中实现仿微信的圆角边框
- 什么时候全表扫描比使用索引扫描能更快?
- c++ Log库,调试库
- 开发者网站
- Android下drawable,Bitmap,Canvas与Paint区别
- 关于PagerAdapter的instantiateItem方法
- Android布局中实现圆角边框
- merge sort 一些变种、应用
- 【ASP.NET北大青鸟】--添加广告控件
- HDU2089(数位DP)
- 史上功能最全面的图形锁
- 【4-1 前端模块】跳板机服务系统设计及实现
- python27 in Centos6
- C++作业4.22
- ndroid:使用百度地图SDK定位当前具体位置(类似QQ发表说说的选择地点功能)