我有这个自定义类......
public class DrawView extends ImageView
当我在setImageBitmap(bitmap)
构造函数中设置DrawView
时
EditText
后面的ImageView
会在屏幕后面填充ImageView
和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>
{{1}}
答案 0 :(得分:1)
您可以通过顶部,底部,左侧,右侧的对齐方式将对象放置在RelativeLayout中,或者相对于另一个子视图使用
进行定位机器人:layout_above = “@ + ID / addtext”
检入属性视图的所有布局选项。
您是否在构造函数中传递了属性集?像这样:
public DrawView(Context context, AttributeSet set) {
super(context, set);
答案 1 :(得分:0)
你应该看一下ImageView中的android:scaleType属性:D
希望它有所帮助 JQcorreia