Erik
Erik

Reputation: 5119

Android: full screen RelativeLayout

I have this custom class ...

public class DrawView extends ImageView

When I set the setImageBitmap(bitmap) inside of the DrawView constructor
The EditText ends up behind the ImageView and ImageView fill the screen.
how should I change my layout to place EditText under the ImageView

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:orientation="vertical"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent"
>
<com.hasse.move.DrawView
   android:id="@+id/mainView"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
 />
<EditText android:id="@+id/addtext"
   android:layout_height="wrap_content"
   android:layout_width="fill_parent"
   android:layout_below="@+id/mainView"
   android:text="aaa"
/>
</RelativeLayout>

Upvotes: 0

Views: 1299

Answers (2)

Lumis
Lumis

Reputation: 21639

You can position your views by aligment top, bottom, left, right in a RelativeLayout or relative to another child view with

android:layout_above="@+id/addtext"

Check in properties all layout options for a view.

Are you passing atribute set in your constructor? like this:

public DrawView(Context context, AttributeSet set) {
        super(context, set);

Upvotes: 1

JQCorreia
JQCorreia

Reputation: 717

You should look at the android:scaleType attribute in the ImageView :D

Hope it helped JQcorreia

Upvotes: 0

Related Questions