ranxrose
ranxrose

Reputation: 255

Error xml rendering this$0 android studio

i got error : Exception raised during rendering this$0

this is my xml :

<?xml version="1.0" encoding="utf-8"?>
ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">


<RelativeLayout
        xmlns:tools="http://schemas.android.com/tools"
        android:padding="@dimen/activity_horizontal_margin"
        android:id="@+id/fairy_animation"
        android:layout_width="wrap_content"
        android:layout_height="match_parent">

    <TextView
            style="@android:style/TextAppearance.Medium"
            android:id="@+id/textview_language"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/layout_container"
            android:layout_alignBaseline="@+id/button_language"
            android:gravity="center_horizontal"
            android:text="@string/text_is_in"/>

    <Spinner
            tools:listitem="@android:layout/simple_spinner_item"
            android:id="@+id/button_language"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/layout_container"
            android:drawSelectorOnTop="true"
            android:layout_toRightOf="@+id/textview_language"
            android:layout_toEndOf="@+id/textview_language"/>
</RelativeLayout>

i don't understand how to fix it. please help. i'm new at this. i'm using android studio 2.0

Upvotes: 1

Views: 237

Answers (2)

nenick
nenick

Reputation: 7438

This issue comes from this line:

tools:listitem="@android:layout/simple_spinner_item"

You can avoid it by removing it or use a different layout. (e.g. simple_list_item_1)

Looks like the same basic issue: https://code.google.com/p/android/issues/detail?id=209139

Upvotes: 2

You have to

change ScrollView.....> to <ScrollView.....>
Add </SCrollView> after </RelativeLayout>

Refer xml rules to gain more knowledge.

Upvotes: 0

Related Questions