Makaveli
Makaveli

Reputation: 96

Dimension line spacing

I am doing a scrolling text view app in android and i want some line spacing between text, but on compilation i am getting a render error indicating my android:lineSpacingExtra="@dimen/line_spacing" cannot be resolved yet i have declared it in the dimens.xml , what could be the issue?

Activity_main.xml

 <TextView
                android:id="@+id/article"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:autoLink="web"
                android:lineSpacingExtra="@dimen/line_spacing"
                android:padding="@dimen/padding_regular"
                android:text="@string/article_text" />

dimens.xml

 <resources>
            <dimen name="padding_regular">padding_regular</dimen>
            <dimen name="line_spacing">line_spacing</dimen>
            </resources>

Upvotes: 0

Views: 276

Answers (1)

Deeksha
Deeksha

Reputation: 576

You have to give a numerical value like this:

 <resources>
        <dimen name="padding_regular">10dp</dimen>
        <dimen name="line_spacing">5dp</dimen>
        </resources>

You can choose "px" or"sp" etc according to your requirements.

Hope this will work!

Upvotes: 1

Related Questions