2013-12-17 23 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