2015-05-01 37 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>