Android的TextView的:文字的颜色上点击颜色、文字、Android、TextView

2023-09-04 03:33:50 作者:対伱、卟奢望

我有一个文本框的行为就像是本地链接,点击它获取的图像从数据库中,并显示它。它并不能ping到服务器的所有的时间。

I have a textfield that behaves like a local link, clicking on it fetches an image from database and shows it. It doesn't ping to server all the time.

下面是XML code文本视图

Here is the xml code for the text view

<TextView android:layout_marginLeft="2dp" android:linksClickable="true"
            android:layout_marginRight="2dp" android:layout_width="wrap_content"
            android:text="@string/Beatles" android:clickable="true" android:id="@+id/Beatles"
            android:textColor="@color/Black"
            android:textSize="12dp" android:layout_height="wrap_content" android:textColorHighlight="@color/yellow" android:textColorLink="@color/yellow"  android:autoLink="all"></TextView>

现在的问题是我希望看到的文本视图颜色应为黄色被改变,而不是相同的黑色为主色调,

The question is i want to see the color of text view should be changed in yellow, instead of the same black color,

俨然不是改变背景颜色的按钮的行为,但我想改变文字颜色

Just Like the button behavior but instead of changing the background color i want to change a text color

推荐答案

看看这里: http://developer.android.com/reference/android/content/res/ColorStateList.html

在这里!: 如何定义ColorStateList为TextView的?

 
精彩推荐