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


看到一个好的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定位结果\n
		62 : 扫描整合定位依据失败。此时定位结果无效。\n
		63 : 网络异常,没有成功向服务器发起请求。此时定位结果无效。\n
		65 : 定位缓存的结果。\n
		66 : 离线定位结果。通过requestOfflineLocaiton调用时对应的返回结果\n
		67 : 离线定位失败。通过requestOfflineLocaiton调用时对应的返回结果\n
		68 : 网络连接失败时,查找本地离线定位时对应的返回结果\n
		161: 表示网络定位结果\n
		162~167: 服务端定位失败\n
		502:key参数错误\n
		505:key不存在或者非法\n
		601:key服务被开发者自己禁用\n
		602:key mcode不匹配\n
		501~700:key验证失败\n</string>
    <string name="qa_callback">问题反馈:\n
        邮件格式格式:\n
		1) 手机标识(移动联通IMEI,电信MEID)\n
		2) 问题发生时间;\n
		3)定位类型:失败(给出返回码),或者不准(给出真实位置)等;\n
		4)具体描述:细节描述,可以给出问题发生的频率或者APP名称,sdk版本等,也可以加上附件如日志,贴图等\n
        </string>
    <string name="qa_callback_mail">反馈邮箱:loc-bugs@baidu.com</string>


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值