HIII ...我能夠從圖像的URL,實際上圖像的URL被存儲在一個字符串數組顯示圖像和我使用了顯示圖像圖像應該如何處於兩個按鈕之間的區域?
URL aURL = new URL(imagePath);
URLConnection conn = aURL.openConnection();
conn.connect();
InputStream is = conn.getInputStream();
BufferedInputStream bis = new BufferedInputStream(is);
Bitmap bm = BitmapFactory.decodeStream(bis);
bis.close();
is.close();
imageLoader.setImageBitmap(bm);
imageLoader.setImageBitmap(bm);
現在我想添加兩個按鈕,這將留下和形象權是指圖像會出現兩個按鍵之間的....我的main.xml是
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical">
<ImageView android:id="@+id/imageLoader"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button android:text="Button" android:id="@+id/next"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</Button>
<Button android:text="Button" android:id="@+id/back"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</Button>
</LinearLayout>
如何做到這一點我熱切提前等待responces ...感謝所有responces ... 。
@rekazeru首先感謝這麼快的響應...當我運行這個代碼按鈕是左和右,但它是在佈局和圖像的頂部是從按鈕下面實際上我想按鈕應該是在圖像的左側和右側,也是圖像之間我認爲我現在可以解釋我的問題... – 2011-05-21 09:23:41
更改'android:layout_alignParentTop =「tru在'Button'聲明中將e:''轉換爲'android:layout_centerVertical =「true」',並且它們將顯示在所需的位置。 – rekaszeru 2011-05-21 09:32:53
非常感謝它的工作....你非常有幫助... :) – 2011-05-21 09:52:22