app第一阶段冲刺第四天
作者:@kuaiquxie
作者的github:https://github.com/bitebita
本文为作者原创,如需转载,请注明出处:https://www.cnblogs.com/dzwj/p/16172006.html
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#A0EF98" android:orientation="horizontal"> <ImageView android:id="@+id/user_info_back" android:layout_width="40dp" android:layout_height="40dp" android:layout_weight="1" android:paddingLeft="10dp" android:src="@drawable/ic_back" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_weight="10" android:gravity="left" android:text="设置" android:textColor="@color/my_title_textcolor" android:textSize="25sp" /> </LinearLayout> <ScrollView android:layout_width="match_parent" android:layout_height="wrap_content"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="15dp" android:background="@drawable/yy_list_bkg_line_bottom" android:orientation="horizontal"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:paddingBottom="10dp" android:paddingLeft="50dp" android:paddingTop="10dp" android:text="消息提醒" android:textSize="20sp" /> <Switch android:id="@+id/s_switch" android:layout_width="wrap_content" android:layout_height="match_parent" android:checked="true" android:paddingBottom="10dp" android:paddingRight="50dp" android:paddingTop="10dp" /> </LinearLayout> <LinearLayout android:id="@+id/ll_msg" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="15dp" android:background="@drawable/address_btn_unselected" android:orientation="horizontal"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:paddingBottom="10dp" android:paddingLeft="50dp" android:paddingTop="10dp" android:text="私信" android:textSize="20sp" /> <RadioButton android:layout_width="wrap_content" android:layout_height="match_parent" android:checked="false" android:paddingBottom="10dp" android:paddingRight="50dp" android:paddingTop="10dp" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/address_btn_unselected" android:orientation="horizontal"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:paddingBottom="10dp" android:paddingLeft="50dp" android:paddingTop="10dp" android:text="留言" android:textSize="20sp" /> <RadioButton android:layout_width="wrap_content" android:layout_height="match_parent" android:checked="true" android:paddingBottom="10dp" android:paddingRight="50dp" android:paddingTop="10dp" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/address_btn_unselected" android:orientation="horizontal"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:paddingBottom="10dp" android:paddingLeft="50dp" android:paddingTop="10dp" android:text="回复" android:textSize="20sp" /> <RadioButton android:layout_width="wrap_content" android:layout_height="match_parent" android:checked="false" android:paddingBottom="10dp" android:paddingRight="50dp" android:paddingTop="10dp" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/address_btn_unselected" android:orientation="horizontal"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:paddingBottom="10dp" android:paddingLeft="50dp" android:paddingTop="10dp" android:text="新粉丝" android:textSize="20sp" /> <RadioButton android:layout_width="wrap_content" android:layout_height="match_parent" android:checked="true" android:paddingBottom="10dp" android:paddingRight="50dp" android:paddingTop="10dp" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/address_btn_unselected" android:orientation="horizontal"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:paddingBottom="10dp" android:paddingLeft="50dp" android:paddingTop="10dp" android:text="系统通知" android:textSize="20sp" /> <RadioButton android:layout_width="wrap_content" android:layout_height="match_parent" android:checked="false" android:paddingBottom="10dp" android:paddingRight="50dp" android:paddingTop="10dp" /> </LinearLayout> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="20dp" android:background="@drawable/address_btn_unselected" android:orientation="horizontal"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:paddingBottom="10dp" android:paddingLeft="50dp" android:paddingTop="10dp" android:text="清除缓存" android:textSize="20sp" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/address_btn_unselected" android:orientation="horizontal"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:paddingBottom="10dp" android:paddingLeft="50dp" android:paddingTop="10dp" android:text="当前版本" android:textSize="20sp" /> <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:paddingBottom="10dp" android:paddingRight="50dp" android:paddingTop="10dp" android:text="V1.0" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/address_btn_unselected" android:orientation="horizontal"> <TextView android:id="@+id/tv_aboutUs" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:paddingBottom="10dp" android:paddingLeft="50dp" android:paddingTop="10dp" android:text="关于我们" android:textSize="20sp" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="15dp" android:background="@drawable/yy_list_bkg_line_bottom" android:orientation="horizontal"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:paddingBottom="10dp" android:paddingLeft="50dp" android:paddingTop="10dp" android:text="退出登录" android:textSize="20sp" /> </LinearLayout> </LinearLayout> </ScrollView> </LinearLayout>
布局展示
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/yy_list_bkg_line_bottom" android:orientation="horizontal"> <ImageView android:layout_width="40dp" android:layout_height="40dp" android:onClick="back" android:paddingLeft="10dp" android:src="@drawable/back" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginLeft="20dp" android:gravity="center" android:text="积分兑换" android:textColor="@color/black" android:textSize="25sp" /> </LinearLayout> <include layout="@layout/banner" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/address_btn_unselected" android:orientation="horizontal" android:padding="5dp"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:orientation="vertical"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingLeft="30dp" android:text="我的积分:1152" android:textSize="20sp" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingLeft="30dp" android:paddingTop="10dp" android:text="如何获取更多积分" android:textSize="15sp" /> </LinearLayout> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:paddingRight="20dp" android:text="兑换记录" /> </LinearLayout> <ScrollView android:layout_width="match_parent" android:layout_height="wrap_content"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/my_list_txt_background" android:orientation="vertical"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#D9D9D9" android:padding="5dp" android:text="可兑换物品" android:textColor="#EDEDED" /> <com.linlang.grasharepro.view.MyGridView android:id="@+id/grid_score_able" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dp" android:layout_weight="10" android:columnWidth="90dp" android:gravity="center" android:horizontalSpacing="10dp" android:listSelector="@drawable/yy_list_bkg_line_press" android:numColumns="3" android:stretchMode="columnWidth" android:verticalSpacing="30dp"></com.linlang.grasharepro.view.MyGridView> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/my_list_txt_background" android:orientation="vertical"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#D9D9D9" android:padding="5dp" android:text="全部物品" android:textColor="#EDEDED" /> <com.linlang.grasharepro.view.MyGridView android:id="@+id/grid_score_enable" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dp" android:layout_weight="10" android:columnWidth="90dp" android:gravity="center" android:horizontalSpacing="10dp" android:listSelector="@drawable/yy_list_bkg_line_press" android:numColumns="3" android:stretchMode="columnWidth" android:verticalSpacing="30dp"></com.linlang.grasharepro.view.MyGridView> </LinearLayout> </LinearLayout> </ScrollView> </LinearLayout>
布局展示
之所以写这个,就是为这个app增加一些趣味性,不然,就是简单的收发帖子,感觉有些单调。
现在,把布局文件写好了,接下来就来写关于后台相关的东西。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· winform 绘制太阳,地球,月球 运作规律
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 上周热点回顾(3.3-3.9)
· AI 智能体引爆开源社区「GitHub 热点速览」