开发者

Android: full screen RelativeLayout

I have this custom class ...

public class DrawView extends ImageView

When I set the se开发者_Go百科tImageBitmap(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>


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);


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

Hope it helped JQcorreia

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜