0

I would like to know how these tags work in android xml. for instance in styling

style="?android:attr/buttonBarButtonStyle" and style="@android:attr/buttonBarButtonStyle"

I've tried to find out my self but these tags gave me almost same result in my previous project. couldn't find out the clear answer on the internet though

and sometimes the android layout xml id's are different @id/ and @+/id?, stating with + sign what is the reason behind that?

Any pioneered Android Dev's in this field?

Kirk
  • 4,957
  • 2
  • 32
  • 59
  • Hope you are doing good,hope you have yours answer now,if in case the answers are correct than please accept that we can move to next question after solving each question completely!! – Jitesh Upadhyay Jan 15 '14 at 05:39

1 Answers1

1

1.@+/id : It is used to assign the Id to the Newly Created View in the Layout

2.@id/ : It is used to get the Reference of the View

Ex: This Will Create New Id

 <Button
        android:id="@+id/ui_button_click"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
/>

Ex: This Will Reference the Id Created

<Button
        android:id="@+id/ui_second_click"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignRight="@id/ui_button_click" --->Referencing the First One
        android:text="Button" />
Nitesh Tiwari
  • 4,742
  • 3
  • 28
  • 46