1

I want to use something like this :

<TextView
            android:id="@+id/text"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:gravity="@string/textview_gravity" >

then in my strings.xml

have something like this:

<string name="textview_gravity" >bottom|right</string>

any ideas? is this even possible?

1
  • 1
    Change gravity in yur code accordingly. In xml I dont think its possible. Commented Aug 20, 2014 at 20:09

2 Answers 2

4

no it is not possible. You should use styles.xml for this sort of things

Sign up to request clarification or add additional context in comments.

Comments

0

I do not believe you can use string constants that way in android. I believe you can only use string constants stored in an attribute field that expects a string field like:

        android:text="@string/some_string" 

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.