문제

I am trying to change the color of the text on a static/immersion card related to medical alerts. Such that an allergy is shown in red and bold colors and is easily noticeable. Is there a way to do this in Glass GDK as the card.SetText() method just takes a String as its parameter and the card is given a layout before.

도움이 되었습니까?

해결책

The GDK Card class does not have functionality to alter the color of text, reference here: https://developers.google.com/glass/develop/gdk/reference/com/google/android/glass/app/Card

However, you can alter text color in your style. Add a line in res/values/styles.xml within your <style> object

<item name="android:textColor">#00FF00</item>

More information on styles and themes here: http://developer.android.com/guide/topics/ui/themes.html

다른 팁

For those who need a solution to this Make your modifications to the textview in the layout and then set that text to the card as-

card.setText((TextView).getText());

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top