簡體   English   中英

Android:全屏RelativeLayout

[英]Android: full screen RelativeLayout

我有這個自定義類...

public class DrawView extends ImageView

當我在DrawView構造函數中設置setImageBitmap(bitmap)
EditText最終在ImageViewImageView后面填充屏幕。
我應該如何更改布局以將EditText放在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>

您可以根據需要在RelativeLayout中以頂部,底部,左側,右側或相對於其他子視圖的位置來定位視圖

android:layout_above =“ @ + id / addtext”

檢入屬性的所有布局選項。

您是否在構造函數中傳遞屬性集? 像這樣:

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

您應該在ImageView中查看android:scaleType屬性:D

希望它對JQcorreia有幫助

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM