您的位置:首页 > 其它

时间轴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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: