这篇博客要实现之前没有实现过的效果,制作表格样式,这是小巫在工作中要实现的效果,花了我不少实现才把效果给做出来。界面设计是一个很大的学问,不知道怎么布局的话是无法设计出漂亮的界面,还有一些控件的属性的使用会出现什么样的效果也是需要去考虑的,ListView可以是用得最多的控件,在这里也是用ListView来实现表格的界面。
看看效果图:
效果是这样的:点击按下弹出表格的按钮,会由下往上弹出右边的列表,按下返回按钮就由上往下退出界面。
布局文件:
activity_main.xml
<RelativeLayout xmlns:android=“http://schemas.android.com/apk/res/android”
android:layout_width=“match_parent”
android:layout_height=“match_parent” >
<Button
android:id=“@+id/btnPopup”
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_alignParentBottom=“true”
android:layout_centerHorizontal=“true”
android:background=“@drawable/bg”
android:layout_marginLeft=“8dp”
android:layout_marginRight=“8dp”
android:layout_marginBottom=“8dp”
android:textColor=“@color/white”
android:text=“按下弹出表格” />
<LinearLayout
android:id=“@+id/ll_popupLayout”
android:layout_width=“match_parent”
android:layout_height=“wrap_content”
android:layout_alignParentBottom=“true”
android:visibility=“gone” >
/Demo1/res/layout/business_list_item.xml
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android”
android:layout_width=“300dp”
android:layout_height=“wrap_content”
android:layout_gravity=“center_horizontal”
android:orientation=“horizontal” >
<TextView
android:id=“@+id/tv_business”
android:layout_width=“wrap_content”
android:layout_height=“40dp”
android:layout_weight=“1”
android:gravity=“center”
android:text=“@string/tv_business”
android:textColor=“#ff000000”
android:textSize=“15sp” />
<TextView
android:id=“@+id/tv_business_pay”
android:layout_width=“90dp”
android:layout_height=“40dp”
android:layout_marginLeft=“9dp”
android:layout_marginRight=“9dp”
android:gravity=“center”
android:text=“@string/tv_business_pay”
android:textColor=“#ff000000”
android:textSize=“15sp” />
/Demo1/res/layout/business_list.xml
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android”
android:id=“@+id/ll_popupLayout”
android:layout_width=“match_parent”
android:layout_height=“match_parent”
android:background=“#ffffff”
android:orientation=“vertical” >
<TextView
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_gravity=“center_horizontal”
android:layout_marginBottom=“5dp”
android:layout_marginTop=“5dp”
android:text=“已开通查分业务列表”
android:textColor=“#ff000000”
android:textSize=“15sp” />
<FrameLayout
android:layout_width=“match_parent”
android:layout_height=“0dp”
android:layout_weight=“1” >
<LinearLayout
android:layout_width=“300dp”
android:layout_height=“wrap_content”
android:layout_gravity=“center_horizontal”
android:background=“@drawable/banner_bg”
android:orientation=“horizontal” >
<TextView
android:id=“@+id/tv_business”
android:layout_width=“wrap_content”
android:layout_height=“40dp”
android:layout_weight=“1”
android:gravity=“center”
android:text=“@string/tv_business”
android:textColor=“#ff000000”
android:textSize=“15sp” />
<TextView
android:id=“@+id/tv_business_pay”
android:layout_width=“90dp”
android:layout_height=“40dp”
android:layout_marginLeft=“9dp”
android:layout_marginRight=“9dp”
android:gravity=“center”
android:text=“@string/tv_business_pay”
android:textColor=“#ff000000”
android:textSize=“15sp” />
<ListView
android:id=“@+id/lv_business”
android:layout_width=“300dp”
android:layout_height=“match_parent”
android:layout_gravity=“center_horizontal”
android:layout_marginTop=“40dp”
android:background=“@drawable/score_list_bg”
android:cacheColorHint=“@color/transparent”
android:divider=“@drawable/horizontal_line”
android:listSelector=“@color/transparent” />
<ImageView
android:layout_width=“wrap_content”
android:layout_height=“match_parent”
android:layout_gravity=“center_horizontal”
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数初中级安卓工程师,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年最新Android移动开发全套学习资料》送给大家,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频
如果你觉得这些内容对你有帮助,可以添加下面V无偿领取!(备注Android)
最后为了帮助大家深刻理解Android相关知识点的原理以及面试相关知识,这里放上相关的我搜集整理的24套腾讯、字节跳动、阿里、百度2020-2021面试真题解析,我把技术点整理成了视频和PDF(实际上比预期多花了不少精力),包知识脉络 + 诸多细节。
还有 高级架构技术进阶脑图、Android开发面试专题资料 帮助大家学习提升进阶,也节省大家在网上搜索资料的时间来学习,也可以分享给身边好友一起学习。
点击:
《Android架构视频+BAT面试专题PDF+学习笔记》即可免费获取~
(实际上比预期多花了不少精力),包知识脉络 + 诸多细节**。
还有 高级架构技术进阶脑图、Android开发面试专题资料 帮助大家学习提升进阶,也节省大家在网上搜索资料的时间来学习,也可以分享给身边好友一起学习。
[外链图片转存中…(img-DW3vnid5-1710827957019)]
[外链图片转存中…(img-DPfJvWdV-1710827957019)]
[外链图片转存中…(img-c7doUCBR-1710827957020)]
点击:
《Android架构视频+BAT面试专题PDF+学习笔记》即可免费获取~
网上学习 Android的资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。希望这份系统化的技术体系对大家有一个方向参考。