<relativelayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:tools= "http// Schemas.android.com/tools "android:id=" @+id/container "android:layout_width=" Match_parent "android:layout_height= "Match_parent" tools:context= "com.example.fingergame.MainActivity" tools:ignore= "Mergerootframe" ><!--comments cannot be written in </> tags--<!--android:layout_width= "Fill_parent" This is consistent with the parent component's right-to-left alignment properties. <textview android:id= "@+id/title" android:layout_width= "fill_parent" android:layout_height= "Wra P_content "android:layout_centerhorizontal=" true "android:layout_margintop=" 5DP "android:gravity=" cen Ter_horizontal "android:textsize=" 20sp "android:textcolor=" #0000FF "android:text=" Scissors games " /> <imageview android:id= "@+id/photo1" android:layout_below= "@id/title" android:layout_width= "Wra P_content "android:layout_height=" wrap_content "android:layout_margintop=" 18DP "android:layout_marginleft=" 60DP " android:src= "@drawable/smileface"/> <imageview android:id= "@+id/photo2" android:layou t_below= "@id/title" android:layout_torightof= "@id/photo1" android:layout_margintop= "18DP" android:layout _width= "Wrap_content" android:layout_height= "wrap_content" android:layout_marginleft= "80DP" android:src= "@ Drawable/smileface "/> <radiogroup android:id= "@+id/chose1" android:layout_width= "wrap_content" android:layout_height= "wrap _content "android:layout_margintop=" 18DP "android:layout_marginleft=" 40DP "android:layout_below=" @id/photo1 "Android oid:orientation= "vertical" > <radiobutton android:id= "@+id/stone1" Android:layout_widt H= "Wrap_content" android:layout_height= "wrap_content" android:layout_below= "@+id/photo1" Android:layo ut_torightof= "@+id/chose1" android:layout_margintop= "20DP" android:checked= "true" android:text= "stone" /> <radiobutton android:id= "@+id/scissors1" android:layout_width= "Wrap_content" Android: layout_height= "Wrap_content" android:layout_below= "@+id/stone1" android:layout_margintop= "20DP" Andro id:layout_torightof= "@+id/chose1" android:text= "scissors"/> <radiobutton android:id= "@+id/cloth1" Android:layout_widtH= "Wrap_content" android:layout_height= "wrap_content" android:layout_below= "@+id/scissors1" android:l ayout_margintop= "20DP" android:layout_torightof= "@+id/chose1" android:text= "cloth"/> </RadioGroup> <!--android:layout_height=" Wrap_content "Chose1 with Zibbi head Android:layout_marginto p= "20DP" more flexible--> <radiogroup android:id= "@+id/chose2" android:layout_width= "Wrap_content" android:layou t_height= "Wrap_content" android:layout_aligntop= "@+id/chose1" android:layout_marginleft= "70DP" android:layout_torightof= "@+id/photo1" android:orientation= "vertical" > <radiobutton Android:id= "@+id/stone2" android:layout_width= "wrap_content" android:layout_height= "Wrap_co Ntent "android:layout_below=" @+id/chose1 "android:layout_margintop=" 20DP "android:l ayout_torightof= "@+id/stone1" android:checked= "true" android:text= "stone"/> <radiob Utton android:id= "@+id/scissors2" android:layout_width= "Wrap_content" android:layou t_height= "Wrap_content" android:layout_below= "@+id/stone2" android:layout_margintop= "20DP" android:layout_torightof= "@+id/scissors1" android:text= "scissors"/> <radiobutton android:id= "@+id/clot H2 "Android:layout_width=" wrap_content "android:layout_height=" Wrap_content "Androi d:layout_below= "@+id/cloth1" android:layout_margintop= "20DP" android:layout_torightof= "@+id/clot H1 "android:text=" cloth "/> </RadioGroup> <button android:id=" @+id/ok1 " Android:layout_width= "75DP" android:layout_height= "35DP" android:layout_below= "@+id/chose 1 "android:layout_margintop=" 20DP "android:layout_alignleft=" @+id/chose1 "android:t ext= "Confirm"/> <button android:id= "@+id/ok2" android:layout_width= "75DP" android:layout_height= "35DP" android:layout_below= "@+id/chose2" android:layout_margintop= "20DP" Android:layout_alignleft= "@+id/chose2" android:text= "confirm"/> <textview android:id= "@+id/copyrig HT "Android:layout_width=" wrap_content "android:layout_height=" Wrap_content "ANDROID:LAYOUT_ALIGNP Arentbottom= "true" android:layout_centerhorizontal= "true" android:layout_marginbottom= "5DP" Androi d:text= "©fingergame 2015 | Designer:amy "/></relativelayout>
Operation Result:
Android Relative Layout instance