2014-10-03 47 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>