Answer the question
In order to leave comments, you need to log in
Android studio throws an error android resource linking failed? when trying to create a list.
I'm trying to create a list in my android app, added spinner widget in xml file
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:ignore="MissingConstraints">
<ImageButton
android:id="@+id/black"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="67dp"
android:src="@drawable/black"
/>
<ImageButton
android:id="@+id/blue"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:src="@drawable/blue"
/>
<ImageButton
android:id="@+id/brown"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:src="@drawable/brown"
/>
<ImageButton
android:id="@+id/gray"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:src="@drawable/gray"
/>
<ImageButton
android:id="@+id/green"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:src="@drawable/green"
/>
<ImageView
android:id="@+id/open"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginLeft="315dp"
android:layout_marginTop="-80dp"
android:src="@drawable/open" />
<ImageView
android:id="@+id/save"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginLeft="315dp"
android:layout_marginTop="20dp"
android:src="@drawable/save" />
<ImageButton
android:id="@+id/purple"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="-10dp"
android:src="@drawable/purple"
/>
<ImageButton
android:id="@+id/red"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:src="@drawable/red"
/>
<ImageButton
android:id="@+id/yellow"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:src="@drawable/yellow"
/>
<EditText
android:id="@+id/text"
android:layout_width="240dp"
android:layout_height="430dp"
android:layout_marginLeft="60dp"
android:layout_marginTop="-425dp"
android:gravity="top"
android:inputType="textMultiLine"
android:scrollHorizontally="false"
android:scrollbars="vertical"
/>
<ImageView
android:id="@+id/justify"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginLeft="75dp"
android:layout_marginTop="0dp"
android:onClick="TextJustify"
android:src="@drawable/justify"
/>
<ImageView
android:id="@+id/center"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="120dp"
android:layout_marginTop="-40dp"
android:onClick="TextCenter"
android:src="@drawable/center"
/>
<ImageView
android:id="@+id/left"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginLeft="180dp"
android:layout_marginTop="-42dp"
android:onClick="TextLeft"
android:src="@drawable/left"
/>
<ImageView
android:id="@+id/right"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginLeft="235dp"
android:layout_marginTop="-35dp"
android:onClick="TextRight"
android:src="@drawable/right"
/>
<ImageView
android:id="@+id/exist"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginLeft="315dp"
android:layout_marginTop="-480dp"
android:onClick="Close"
android:src="@drawable/exist"
/>
<Spinner
android:id="@+id/size"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginLeft="80dp"
android:layout_marginTop="-40dp"
android:entries="@array/sizes"
/>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
<resources>
<string-array name="sizes">
<item>5</item>
<item>10</item>
<item>15</item>
</string-array>
</resources>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question