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

+0

используйте 'RelativeLayout' и поставьте все, что хотите, и где угодно. – Rustam

ответ

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> 
Смежные вопросы