我正在做一个数字时钟在我的安卓项目,问题是,数字时钟是折旧以上的api水平17和TextClock是介绍。我的项目api级别是最小10和最大19。
我确实找到了back support库的链接,但我想知道如何使用back support库。有人能帮上忙吗。
我确实将它导入了我的支持库中,但是TextClock标记仍然给出了错误,有人可以提前帮忙,谢谢。这是后台支持库链接!
发布于 2014-03-18 06:13:20
我是第一个挣扎的,但这是我怎么做的。
1)下载zip文件并解压缩它
2)将其导入eclipse
3)将支持库添加到我的项目中(右键单击项目,转到Properties->Android-> library -> Add )并选择支持项目
4)由于我已经在我的项目中添加了android支持库,所以我在其中一个项目中删除了它们,否则会产生错误。
5)现在一切都安排在这里,这就是我使用的方法。
XML:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<cz.vhrdina.textclockbackport.TextClock
android:id="@+id/digitalClock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/dclock_label"
android:textAppearance="?android:attr/textAppearanceLarge" />.
是Java代码:
import cz.vhrdina.textclockbackport.TextClock;.
TextClock digitalClock=(TextClock) findViewById(R.id.digitalClock);发布于 2014-03-18 06:21:06
尝尝这个
tv = (TextView) findViewById(R.id.myTextView);
Drawable dd = this.getResources().getDrawable(R.drawable.ractangle);
**Deprecated** //tv.setBackgroundDrawable(dd);tv.setTextColor(this.getResources().getColor(R.color.lalcolor));与tv.setBackground(Dd)一起更改
https://stackoverflow.com/questions/22471646
复制相似问题