2011-09-17 7 views
1

イメージ以外に次と戻るボタンを表示するためにxmlレイアウトに問題があり、イメージの高さの中間にあるはずです。イメージアンドロイドの高さの半分の前後にボタンを表示

plsは次のURLを参照してください

http://screencast.com/t/zE47nb0rkFE

二つのボタンが画像の上にある、それは画像の中央高さ、左右ではなく、されています。 であり、それはスクリーンのあらゆる解像度のサイズのためにあるはずです。

私のxmlは、私は別のRelativeLayoutであなたのイメージを同封し、それにボタンを追加したい

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

を利用スクロールビュー:: –

答えて

1

あなたは、このようなコードでscrollviewを使用することができます::

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:background="#FFFFFF"> 
<ScrollView android:id="@+id/ScrollView01" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent"> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    > 
<WebView 
android:id="@+id/imv" 
android:orientation="vertical" 
android:layout_width="fill_parent" 
android:layout_height="55dip" 
/> 

<ImageView 
android:id="@+id/imagegallery" 
android:layout_width="70sp" 
    android:layout_height="70sp" 
    android:layout_alignParentRight="true" 
    android:layout_below="@id/imv"/> 
<ProgressBar 
    android:id="@+id/Bar" 
    android:layout_width="wrap_content" 
    android:layout_centerInParent="true" 
    android:layout_height="wrap_content" 
    android:layout_above="@id/imagegallery" 
    android:layout_below="@id/imv" 
/> 

<TextView android:layout_height="wrap_content" 
    android:id="@+id/textView1" 
    android:text="Art Gallery" 
    android:textColor="#000000" 
    android:layout_width="wrap_content" 

    android:layout_below="@id/imv" 
    /> 
    <TextView android:layout_height="wrap_content" 
    android:id="@+id/textView2" 
    android:textColor="#00C000" 
    android:textSize="20dip" 
    android:text=" " 
    android:layout_width="wrap_content" 
    android:layout_toLeftOf="@id/imagegallery" 
    android:layout_alignParentLeft="true" 
    android:layout_below="@id/textView1" 
    /> 
    <TextView android:layout_height="wrap_content" 
android:id="@+id/textopeningnow" 
android:text="Opening Now" 
android:textColor="#000000" 
android:layout_width="wrap_content" 
    android:layout_below="@id/textView2" 
/> 
<TextView android:layout_height="wrap_content" 
android:id="@+id/diosas" 
android:textSize="20dip" 
android:text="Diosas/Godesses" 
android:textColor="#00C000" 
android:layout_width="wrap_content" 
    android:layout_below="@id/textopeningnow" 
/> 

    <Button 
    android:id="@+id/back" 
    android:layout_height="wrap_content" 
    android:layout_width="25dip" 
    android:layout_centerVertical="true" 
    android:background="@drawable/leftarrow"/> 
    <Button 
    android:id="@+id/next" 
    android:layout_height="wrap_content" 
    android:layout_width="25dip" 
    android:layout_alignParentRight="true" 
    android:layout_centerVertical="true" 
    android:background="@drawable/rightarrow"/> 

<ImageView android:id="@+id/imageLoader" 
    android:layout_width="wrap_content" 
    android:layout_height="200dip" 
    android:layout_toLeftOf="@id/next" 
    android:layout_toRightOf="@id/back" 
    android:layout_below="@id/diosas" 
    /> 

    <TextView 
    android:id="@+id/artistname" 
    android:textColor="#000000" 
    android:text=" " 
    android:layout_height="wrap_content" 
    android:layout_width="wrap_content" 
    android:layout_below="@id/imageLoader" 
    android:layout_centerInParent="true" 
    /> 
</LinearLayout> 
</ScrollView> 
    </RelativeLayout> 
0

です。グローバルな相対レイアウトだけでは望みのものを達成しようとするのは難しいです。

+0

ちょっと私は..plsを理解していないuはsame..howのためのウルXMLを共有することができますuがで画像を囲みます別のRelativeLayout ...ありがとう – shyam

+0

EclipseのUIエディタに移動し、独自のレイアウト(あなたの場合は画像です)に囲みたいウィジェットを右クリックし、「ラップインコンテナ」を選択します。 – Macondo2Seattle

関連する問題