我在网上看到有代码这样的,在布局文件里面,访问drawable的颜色
<TextView
android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@drawable/black" </TextView>
但是我这里eclipse老是报错,请问怎么改?
<TextView
android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@drawable/black" </TextView>
但是我这里eclipse老是报错,请问怎么改?
解决方案 »
- listview下拉刷新 和分页的问题
- 【整套18个视频】【高清】Android(安卓)游戏及应用开发
- 推荐款反编译工具
- 请问如何获取系统路由表信息。
- 急:Activity中我设置点击某个EditText会跳出DatePickerDialog,没想到点击完后,再点其他EditText也跳出,怎么能设置不让它跳出
- 100分 求Android上可用的 MP3音频编码库
- bluetooth obexftp
- SurfaceView与滑动页面冲突问题,求解决
- 请问 如何设置全部的Activity使用一个actionbar
- 【新手求助】关于AdapterView的几个小问题。
- (Android)在自定义的Adapter添加图片
- linux的eclipse开发android没法用手机运行
楼主没有发现你的xml文件代码写错了吗?应该这样写的,如下所示:<TextView
android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@drawable/black" >
</TextView>
或者这样写:
<TextView
android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@drawable/black"/>
楼主没有发现你的xml文件代码写错了吗?应该这样写的,如下所示:<TextView
android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@drawable/black" >
</TextView>
或者这样写:
<TextView
android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@drawable/black"/>
R.color.black;XML中访问系统颜色:
前提有color.xml, android:textColor="@color/black", 或者直接用android:textColor="#000000"