سؤال

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