我正在寻找一种方法来修复 TextView,例如,像我在 Paint.net 中做的图片中的透明正方形。所以 TextView 应该在透明正方形 (ImageView) 的前面。它也应该拉伸(stretch)时屏幕更大。
http://www7.pic-upload.de/22.02.14/24vtze5ulxc2.png
我该如何解决这个问题? 谢谢!
最佳答案
使用框架布局
<FrameLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/semi_transparent_background"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="This is my text."/>
</FrameLayout>
或者,您可以使用相对布局执行类似的操作。
关于java - 将 TextView 放在 ImageView 前面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21947076/