是否可以将drawableLeft外部设置为TextViews 9补丁背景?
我用的是这个代码:
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/background_9patch"
android:drawableLeft="@drawable/leftImg"
android:text="Hello World" />我希望“@android:drawableLeft=/leftImg”将位于android:drawableLeft=的左边。
发布于 2013-04-20 20:16:46
由于您的背景是一个自定义的9补丁,您可以修改背景图像,使其在可伸缩内容的左侧有一个固定大小的透明部分,为左侧Drawable提供足够的填充。这就是框架如何为像CheckBox这样的小部件创建背景,这些小部件将文本移到相应按钮旁边。
https://stackoverflow.com/questions/16124687
复制相似问题