How can I dynamically set the gravity ?
Bitmap bmp;
im = new ImageView (this);
bmp=getbmp(img);
im.setImageBitmap(bmp);
Now I would like to put the image in the top . Ho can I do this without android:gravity
in 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>
I have a frame layout and I add to it the image , and then the text and I would like the image to be on the top of the screen.
FrameLayout fm = new FrameLayout (this);
fm.addView(im);
fm.addView(fin); // fin = the text view
setContentView(fm);