Androidx学习笔记(33)---新闻客户端之布局
来源:互联网 发布:注射死刑 知乎 编辑:程序博客网 时间:2024/06/05 02:27
简要布局界面
layout
由于是新闻,所以会用到列表
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" > <ListView android:id="@+id/lv" android:layout_width="match_parent" android:layout_height="match_parent" ></ListView></RelativeLayout>
item_list
参考界面设计出列表项<?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="wrap_content" > <!-- 显示图片--> <com.loopj.android.image.SmartImageView android:id="@+id/iv" android:layout_width="90dp" android:layout_height="70dp" android:src="@drawable/ic_launcher" android:layout_centerVertical="true" /><!-- 显示标题 singleLine是单行--> <TextView android:id="@+id/tv_title" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="这是大标题志哥教你上塑料adasfsadfdsfdsgsd" android:layout_toRightOf="@id/iv" android:textSize="22sp" android:singleLine="true" /> <!-- 显示内容 android:lines="2" 至多显示两行 --> <TextView android:id="@+id/tv_detail" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="这是正文志哥教你带崩三路adasfsadasdasdasdasidhsakjhdkjashdkjahskjdhsakjdfdsfdsgsd" android:layout_toRightOf="@id/iv" android:layout_below="@id/tv_title" android:textSize="15sp" android:textColor="@android:color/darker_gray" android:lines="2" /> <TextView android:id="@+id/tv_comment" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="65031条评论" android:textColor="#ff0000" android:layout_alignParentRight="true" android:layout_below="@id/tv_detail" /></RelativeLayout>
0 0
- Androidx学习笔记(33)---新闻客户端之布局
- Androidx学习笔记(34)---新闻客户端之获取新闻xml文件并解析
- Androidx学习笔记(35)---新闻客户端之ListView显示新闻内容&ViewHolder优化
- Androidx学习笔记(6)--常见布局--线性布局
- Androidx学习笔记(7)--常见布局--相对布局
- Androidx学习笔记(8)--常见布局--帧布局
- Androidx学习笔记(15)-- 数据存储之openFileOutput()
- Androidx学习笔记(16)-- 数据存储之 SharedPreference
- Androidx学习笔记(17)-- 数据存储之XML
- Androidx学习笔记(9)-- logcat
- Androidx学习笔记(18)-- junit单元测试
- Androidx学习笔记(19)-- SQLite 简介
- Androidx学习笔记(21)-- SQLite 事务
- Androidx学习笔记(24)-- ArrayAdapter&SimpleAdapter
- Androidx学习笔记(24)--对话框
- Androidx学习笔记(48)--- 创建Activity
- Androidx学习笔记(51)--- Activity生命周期
- Androidx学习笔记(55)--- 广播接收者
- 深度学习方法(六):神经网络weight参数怎么初始化
- 1037. 在霍格沃茨找零钱(20)
- 字典树
- 安装jdk1.8
- 正则替换特殊字符
- Androidx学习笔记(33)---新闻客户端之布局
- Theano的一个关于signal,signal/conv,signal/downsample的错误
- 【算法-字符串】【WERTYU】
- JAVA中的内部类
- iptables(一)
- 【NYOJ】[75]日期计算
- 黑马程序员——Java正则表达式
- struts2全局结果
- struts2-通过action从后台将json数据传到前台的方法(二)