2014-10-03 49 views
0

我正在制作一个Android应用程序,其中我有一个ImageView和一个Forward Arrow Button,我只想在图像上方屏幕右中心显示按钮。 这里是我的代码.....在Android中显示上方图像按钮

<ImageView 
    android:id="@+id/ImageShow" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" /> 

<EditText 
android:id="@+id/postal_address" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:hint="@string/postal_address_hint" 
android:inputType="textPostalAddress" /> 
+1

哪里是形象? – Piyush 2014-10-03 09:39:58

+0

使用'RelativeLayout'并放置任何你想要的和任何地方。 – Rustam 2014-10-03 09:44:12

回答

0

也许你可以尝试这样的事:

<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:orientation="vertical"> 

    <ImageView 
     android:id="@+id/ImageShow" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" /> 

    <Button 
     android:id="@+id/YOUR_BUTTON_ID" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_above="@id/ImageShow" /> 

</RelativeLayout> 
0
<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:orientation="vertical"> 

    <ImageView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" /> 

    <Button 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_centerInParent="true" 
     android:layout_alignParentRight="true" 
     /> 

</RelativeLayout>