我想在不干扰我的背景图像的情况下填充我的 textview,但是当我在相对布局上进行填充时,它会从周围裁剪我的背景而且当我尝试从 textview 中填充时,它会裁剪我的文本
这是我的代码
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".TesbihMainActivity" >
<ImageView
android:id="@+id/backroundimage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:scaleType="centerCrop"
android:src="@drawable/tesbihbackround"
/>
<TextView
android:id="@+id/display"
android:layout_width="fill_parent"
android:layout_height="63dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="#e9ebec"
android:text=" 385 "
android:gravity="center"
android:textSize="52dp"
android:textColor="#3c677b"
android:textAppearance="?android:attr/textAppearanceLarge" />
</RelativeLayout>
最佳答案
您可以在 textView 上使用 android:layout_margin=""
而不是 android:padding=""
。
这将在 TextView 中为 textView 的所有方向(顶部、底部、左侧和右侧)创建带有插入值的边距
如果您想要应用特定的边距,您也可以使用这些:
android:layout_marginLeft=""
android:layout_marginTop=""
android:layout_marginRight=""
android:layout_marginBottom=""
关于android - 如何在 Android 上塑造 webview?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21885623/