Android中TextView通过换行实现条目布局

来源:互联网 发布:软件行业前景预测 编辑:程序博客网 时间:2024/05/16 19:54


看到一个好的UI界面布局:

<ScrollView 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" >    <RelativeLayout        android:layout_width="match_parent"        android:layout_height="match_parent"        android:paddingBottom="@dimen/activity_vertical_margin"        android:paddingLeft="@dimen/activity_horizontal_margin"        android:paddingRight="@dimen/activity_horizontal_margin"        android:paddingTop="@dimen/activity_vertical_margin"        tools:context=".MainActivity" >        <TextView            android:id="@+id/main_title"            android:layout_width="fill_parent"            android:layout_height="wrap_content"            android:gravity="center_horizontal"            android:text="@string/qa_title"            android:textSize="@dimen/main_title_size" />        <TextView            android:id="@+id/error_code_title"            android:layout_width="fill_parent"            android:layout_height="wrap_content"            android:layout_below="@id/main_title"            android:text="@string/error_code_desc"            android:textSize="@dimen/main_title_size" />        <TextView            android:id="@+id/error_code_content"            android:layout_width="fill_parent"            android:layout_height="wrap_content"            android:layout_below="@id/error_code_title"            android:text="@string/error_code_detail"            android:textSize="@dimen/main_title_size" />        <TextView            android:id="@+id/call_back_title"            android:layout_width="fill_parent"            android:layout_height="wrap_content"            android:layout_below="@id/error_code_content"            android:text="@string/qa_callback"            android:textSize="@dimen/main_title_size" />        <TextView            android:id="@+id/call_back_content"            android:layout_width="fill_parent"            android:layout_height="wrap_content"            android:layout_below="@id/call_back_title"            android:text="@string/qa_callback_mail"            android:textSize="@dimen/main_title_size" />    </RelativeLayout></ScrollView>

主要是文本格式:

    <string name="error_code_detail"> 61 : GPS定位结果\n62 : 扫描整合定位依据失败。此时定位结果无效。\n63 : 网络异常,没有成功向服务器发起请求。此时定位结果无效。\n65 : 定位缓存的结果。\n66 : 离线定位结果。通过requestOfflineLocaiton调用时对应的返回结果\n67 : 离线定位失败。通过requestOfflineLocaiton调用时对应的返回结果\n68 : 网络连接失败时,查找本地离线定位时对应的返回结果\n161: 表示网络定位结果\n162~167: 服务端定位失败\n502:key参数错误\n505:key不存在或者非法\n601:key服务被开发者自己禁用\n602:key mcode不匹配\n501~700:key验证失败\n</string>    <string name="qa_callback">问题反馈:\n        邮件格式格式:\n1) 手机标识(移动联通IMEI,电信MEID)\n2) 问题发生时间;\n3)定位类型:失败(给出返回码),或者不准(给出真实位置)等;\n4)具体描述:细节描述,可以给出问题发生的频率或者APP名称,sdk版本等,也可以加上附件如日志,贴图等\n        </string>    <string name="qa_callback_mail">反馈邮箱:loc-bugs@baidu.com</string>


原创粉丝点击