【发布时间】:2016-06-23 16:49:46
【问题描述】:
这与其他问题不同,因此请尝试理解我的问题。 我有
test.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="ring" >
<size
android:height="30dp"
android:width="30dp" />
<solid android:color="#009688" />
我的 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"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.bradley.learndrawable.MainActivity" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/test"
android:text="2"
android:textStyle="bold"
android:gravity="center"
android:textColor="#FFFFFF" />
它应该将文本视图显示为一个绿色的圆圈和一个白色的数字。 它在图形视图上运行良好,但在实际设备上却不行。
我已将可绘制对象复制到每个可绘制文件夹。 对我来说还是没有好运气。
帮助! :)
【问题讨论】:
-
应该只是在可绘制文件夹中,之后什么都没有。
-
我用的是Eclipse哥☺
-
如果将文本颜色设置为黑色会怎样?文字是否可见?
-
是的,文字是可见的,我之前也试过,但背景不可见
标签: android xml shape xml-drawable