2010-10-22 25 views
0

我想要有一个自定义布局,我将在上面有一个画廊,然后在它下面有一个简单的小部件,以便在从画廊中选择时显示图片。我无法弄清楚如何编写main.xml来实现它,你的建议将不胜感激。如何绘制视图的组合

画廊布局xml是直接从谷歌教程和工作。我如何修改它以达到上述目的?

的android:layout_width = “FILL_PARENT”
机器人:layout_height = “WRAP_CONTENT” />

HT

+0

什么编程语言和d环境是这样的吗? – 2010-10-22 18:00:10

+0

对不起,我应该提到,这是Android编程 – Henry 2010-10-22 18:03:21

回答

0

好吧,我已经想通了为自己,为别人谁未来可能需要这个,main.xml看起来如下:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
     android:layout_height="fill_parent"> 

<Gallery xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/gallery"  
    android:layout_width="fill_parent"  
    android:layout_height="wrap_content" 
/> 
<ImageView 
    android:id="@+id/image1" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_below="@id/gallery" 
    android:layout_alignParentRight="true" 
    android:layout_marginLeft="10dip" 
    /></RelativeLayout>