android - toLeftOf resource not found -


i've used toleftof many times before stopped working. tried:

android:layout_toleftof="@id/spacer" 

here view:

<view     android:id="@+id/spacer"     android:layout_width="0dp"     android:layout_height="wrap_content"     android:layout_centerhorizontal="true"     android:layout_marginleft="@dimen/center_margin"     android:layout_marginstart="@dimen/center_margin"     android:layout_marginright="@dimen/center_margin"     android:layout_marginend="@dimen/center_margin" /> 

and gave me errors:

error:(16, 34) no resource found matches given name (at 'layout_toleftof' value '@id/spacer'). error:(17, 35) no resource found matches given name (at 'layout_tostartof' value '@id/spacer'). 

it works @ other points in app reason doesn't work here. know whats wrong?

edit - yes in relativelayout. here condensed version:

<relativelayout  xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:screenorientation="portrait" android:fitssystemwindows="true" android:focusableintouchmode="true" >  <textview     android:id="@+id/txt1" />  <view     android:id="@+id/spacer" />  <textview     android:id="@+id/txt2" />  </relativelayout> 

upon further review figured out issue trying reference view before made. fixed changing @id/spacer @+id/spacer


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -