2015-05-01 70 views
0

我想创建一个时间表,看起来像这样(没有任何库,它可以帮助enter image description here时间轴开发的Android

谁可以给我就怎么做或教程,请

谢谢你的想法

+4

这似乎不是一个ListView仅此而已......只要使用“聪明”的图形元素,以给** **错觉的连接线。 –

+0

安装应用程序,然后使用**'uiautomatorviewer' **看看他们是如何做到的。 – CommonsWare

回答

-2
It's a simple ListView or RecyclerView with cells like those : 

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:orientation="horizontal" 
    android:layout_width="match_parent" 
    android:layout_height="100dp"> 

    <RelativeLayout 
     android:layout_width="100dp" 
     android:layout_height="match_parent"> 

     <View 
      android:layout_width="1dp" 
      android:layout_height="match_parent" 
      android:layout_above="@+id/date" 
      android:layout_centerHorizontal="true" 
      android:background="#C00" 
      /> 

     <TextView 
      android:id="@+id/date" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_centerInParent="true" 
      android:background="#C00" 
      android:padding="10dp" 
      tools:text="22" 
      android:textColor="@android:color/white"/> 

     <View 
      android:layout_width="1dp" 
      android:layout_centerHorizontal="true" 
      android:layout_height="match_parent" 
      android:layout_below="@+id/date" 
      android:background="#C00" 
      /> 

    </RelativeLayout> 

    <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 

     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_centerVertical="true" 
      android:textColor="#C00" 
      tools:text="This saturday" 
      android:textStyle="bold"/> 

    </RelativeLayout> 

</LinearLayout>