时间轴two
2015-07-27 11:01
309 查看
今天 郁闷 搞了一天, 刚好今天 自己的 4.2.2的手机 放家里了, 公司用 4.3的 三星 note2 做时间轴
结果 打死都这样 ,中间的 9.png 图片无法拉伸 ,气死,
后来 找朋友救援 , 他说他的手机可以。 我郁闷死了 找不到原因
结果一回家, 把代码重新撞到我的 4.22机器上, 居然好了。
看来 和 操作系统版本有关系。 所以 中间图片的线 不能用 。9.png拉伸
最后没办法, 在 装listview的 配置文件 增加一个 absloulete一根线 才搞定
用4.22的机器 效果是正常的
修改代码 适配 2个 机器
<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"
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="zms.zte.listview.activity.TimeLine" >
<AbsoluteLayout
android:layout_width="wrap_content"
android:layout_height="match_parent" >
<View
android:layout_width="1dp"
android:layout_height="fill_parent"
android:layout_x="64dp"
android:background="@color/maroon"
/>
</AbsoluteLayout>
<ListView
android:id="@+id/timeListV"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:dividerHeight="10dp"
android:divider="@drawable/dx_42"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" >
</ListView>
</RelativeLayout>
items布局文件
<?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="match_parent"
android:layout_marginTop="10dp "
android:layout_marginBottom="10dp"
>
<TextView
android:id="@+id/time"
android:layout_width="50dp"
android:layout_height="70dp"
android:layout_alignParentLeft="true"
android:layout_centerInParent="true"
android:gravity="center_vertical"
android:layout_marginLeft="2dp"
android:text="tt" />
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_toRightOf="@id/imageView1"
android:background="@drawable/memo"
android:text="zms" />
<!-- android:layout_alignTop="@id/title"
android:layout_alignBottom="@id/title" -->
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@id/title"
android:layout_alignBottom="@id/title"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/time"
android:background="@drawable/yuan"
/>
</RelativeLayout>
结果 打死都这样 ,中间的 9.png 图片无法拉伸 ,气死,
后来 找朋友救援 , 他说他的手机可以。 我郁闷死了 找不到原因
结果一回家, 把代码重新撞到我的 4.22机器上, 居然好了。
看来 和 操作系统版本有关系。 所以 中间图片的线 不能用 。9.png拉伸
最后没办法, 在 装listview的 配置文件 增加一个 absloulete一根线 才搞定
用4.22的机器 效果是正常的
修改代码 适配 2个 机器
<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"
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="zms.zte.listview.activity.TimeLine" >
<AbsoluteLayout
android:layout_width="wrap_content"
android:layout_height="match_parent" >
<View
android:layout_width="1dp"
android:layout_height="fill_parent"
android:layout_x="64dp"
android:background="@color/maroon"
/>
</AbsoluteLayout>
<ListView
android:id="@+id/timeListV"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:dividerHeight="10dp"
android:divider="@drawable/dx_42"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" >
</ListView>
</RelativeLayout>
items布局文件
<?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="match_parent"
android:layout_marginTop="10dp "
android:layout_marginBottom="10dp"
>
<TextView
android:id="@+id/time"
android:layout_width="50dp"
android:layout_height="70dp"
android:layout_alignParentLeft="true"
android:layout_centerInParent="true"
android:gravity="center_vertical"
android:layout_marginLeft="2dp"
android:text="tt" />
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_toRightOf="@id/imageView1"
android:background="@drawable/memo"
android:text="zms" />
<!-- android:layout_alignTop="@id/title"
android:layout_alignBottom="@id/title" -->
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@id/title"
android:layout_alignBottom="@id/title"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/time"
android:background="@drawable/yuan"
/>
</RelativeLayout>
相关文章推荐
- javascript写了个循环,但是不循环
- Git使fork项目与源项目保持一致方法
- Iterator迭代器、Comparable、Comparator比较器
- 判断手机号和邮箱
- Activity切换淡入淡出效果
- 如何用报表解决销售工作衡量问题
- CodeForces 463C - Gargari and Bishops
- android电池驱动(四)(自用)
- ASP.NET MVC的Razor引擎一:View编译原理
- vim和gvim基本配置
- Android使用http协议的GET和POST方法!!!
- SAP的实施公司有哪些?
- NSDateFormat
- 如何用报表解决销售工作衡量问题
- BAT文件语法和技巧文档
- JAVA调用CMD命令
- 修改Linux内核参数提高Nginx服务器并发性能
- oracle中的exists 和not exists 用法详解
- Java启动线程的方法
- 简单实现listview可选择的列表(不用重写adapter)