开发者

Android: full screen RelativeLayout

开发者 https://www.devze.com 2023-03-05 01:34 出处:网络
I have this custom class ... public class DrawView extends ImageView When I set the se开发者_Go百科tImageBitmap(bitmap) inside of the DrawView constructor

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

精彩评论

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

关注公众号