我为 TextView 设置了背景。我希望背景会根据我现有的布局参数进行调整,并且不会改变我的 TextView 的大小。因此,如果我将宽度和高度设置为 wrap_content,我希望背景也会包裹内容(并按比例缩小)。但是不,我得到的是更大的 TextView
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="a"
android:textColor="#ffffff"
android:textSize="20sp"
android:background="@drawable/large_bg"
/>
我明白了
...
如何使背景也服从 wrap_content?
我的意思是,这看起来像背景将被视为内容......