どのように動的に重力を設定できますか?Androidイメージビューの重力
Bitmap bmp;
im = new ImageView (this);
bmp=getbmp(img);
im.setImageBitmap(bmp);
ここで画像を上に置きます。こんにちは、android:gravity
をmain.xmlに入れずにこれを行うことはできますか?
EDIT:
main.xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:scrollbars="vertical"
>
</ScrollView>
私は、フレームのレイアウトを持っていると私はそれに画像を追加し、テキストと私はイメージがの上になりたいです画面。
FrameLayout fm = new FrameLayout (this);
fm.addView(im);
fm.addView(fin); // fin = the text view
setContentView(fm);
詳細をご覧ください。あなたのレイアウトファイルを投稿してください。 –
編集を完了しました。 – Teo
ImageViewをレイアウトファイルに入れないだけの理由はありますか? –