Skip to content Skip to sidebar Skip to footer

Error: No Resource Identifier Found For Attribute 'textalignment' In Package 'android'

This is my res/layout mobile.xml file. Where is my mistake? When I run textview has this error.

Solution 1:

textAlignment was added in API level 17 (Android 4.2).

Your emulator/device will need to be running 4.2+ for this to work.

Otherwise just use android:gravity="center"

<TextView
    android:id="@+id/grid_item_label"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="15dp"
    android:text="@+id/label"
    android:textSize="25dp"
    android:gravity="center" />

Solution 2:

I think what problem could be in this line:

android:text="@+id/label"

try this:

android:text="@string/label"

Post a Comment for "Error: No Resource Identifier Found For Attribute 'textalignment' In Package 'android'"