2011-12-08 55 views
0

我在Android的世界是新,我想作这种类型的Android界面: http://android.appstorm.net/wp-content/uploads/2011/03/picplz-sc.jpg (左屏幕)布局 - 安卓

但是,我添加了两个图标,我的XML,但这些图标都没有......旁边(而不是在同一条线路)

的XML如下:

<?xml version="1.0" encoding="utf-8"?> 

    <LinearLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" android:layout_width="fill_parent" 
android:layout_height="fill_parent" android:background="#ABABAB"> 

<ImageView android:layout_width="fill_parent" android:id="@+navigate/title" 
android:layout_height="wrap_content" 
android:src="@drawable/myimg" android:layout_marginTop="30px" /> 

<ImageView 
android:layout_width="fill_parent" android:id="@+navigate/bookings" 
android:layout_height="wrap_content" 
android:src="@drawable/inventory" android:layout_marginTop="20px" android:layout_marginRight="150px" 
/> 

<ImageView 
android:layout_width="fill_parent" android:id="@+navigate/picture" 
android:layout_height="wrap_content" 
android:src="@drawable/picture" android:layout_marginLeft="150px" 
/> 

</LinearLayout> 

是什么人有布局的一个很好的教程吗? :) Thx任何帮助

+0

这种布局是垂直的。垂直意味着一个在另一个之上。 – njzk2

回答

1

这是一个好的开始。这是基本的,它帮助我:http://developer.android.com/guide/topics/ui/layout-objects.html

另外,如果你是刚刚起步与Android的布局,这是一个必须阅读文章:http://developer.android.com/guide/practices/screens_support.html

+0

谢谢jwatts1980! – nick

+0

没问题,尼克。我喜欢菲尔的联系比我的第一个更好。但我仍然鼓励你阅读我发布的第二个链接。所有这些都值得一读,但其中一些应该读得很好。有一节讨论如何使用“dp”单位表示对象,使用“sp”单位表示文本。使用dp和sp将允许Android自动缩放您的对象和文本以适应Android的各种屏幕尺寸。只能在特殊情况下使用px单位。 – jwatts1980