2013-12-17 106 views
2

我試圖做一個不錯的應用程序,並在此應用程序;
我想提出一個時間表和時間表將包括"Image", "2 TextBlock" and "2 Buttons"
我該如何創建類似的東西。我將從web api service獲取我的數據。
我發現進行異步調用來獲取數據,但無法創建時間線的模式。在Android中創建時間軸

我該怎麼辦?

enter image description here

等待您的意見,謝謝。我GOOGLE了很多,但始終發現基本listviews

+0

您可以創建類似於您的圖像的XML文件。使用相對和線性佈局來設計你的結構 –

+0

我使用片段視圖爲我的選項卡。我怎麼能把它放在fragmentlayout裏面? –

+0

你可以設計一個xml,並通過代碼將它膨脹到你的分片佈局。 –

回答

1
<LinearLayout orientation="vertical"> 

</ImageView> 

<LinearLayout orientation="horizontal"> 
</TextBox> 
</TextBox> 
</LinearLauout> 

<LinearLayout orientation="horizontal"> 
</Button> 
</Button> 
</LinearLauout> 

</LinearLayout> 
1

下圖描述了你的頁面的設計視圖

THIS FULFILLS YOUR REQUIREMENT

編輯:我如何劃分線性佈局等於2塊?

<LinearLayout 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:orientation="vertical" > 

<LinearLayout 
    android:id="@+id/btn_row" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:orientation="horizontal" 
    android:weightSum="10" > 

    <Button 
     android:id="@+id/btn1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center" 
     android:layout_weight="5" 
     /> 

    <Button 
     android:id="@+id/btn2" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center" 
     android:layout_weight="5" /> 
</LinearLayout> 
</LinearLayout> 
+0

你能幫我解決這個按鈕問題嗎?我怎樣才能將線性佈局等分爲兩部分?謝謝。 –

+0

@KuthayGumus我已經更新了答案plz看看 – Amith