<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<TextView
android:id="@+id/pickerDialog_title"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:gravity="left|center_horizontal"
android:text="HELLO WORLD!!" />
<NumberPicker
android:id="@+id/pickerDialog_selector"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/pickerDialog_title" />
<Button
android:id="@+id/pickerDialog_cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/pickerDialog_selector"
android:layout_toLeftOf="@id/pickerDialog_set" //Cannot find @id/pickerDialog_set
android:gravity="center"
android:text="Cancel" />
<Button
android:id="@+id/pickerDialog_set" //Here it is
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/pickerDialog_selector"
android:layout_toRightOf="@id/pickerDialog_cancel"
android:gravity="center"
android:text="Set" />
</merge>
No resource found that matches the given name (at layout_toLeftOf with value @id/pickerDialog_set
It was my understanding that, android:id
should be prefixed as @+id/
, with reference made to the view to be prefixed as @id/
How do i reference ids correctly?
You should change the order of the Button that is toLeftOf the one this one button, because you can not use an id, before it is created. Your code should looks like this:
and remove the
android:layout_toRightOf
of thepickerDialog_set
Button like I did in the code above