Note that there are some explanatory texts on larger screens.

plurals
  1. POShow button in relativelayout
    text
    copied!<p>I'm having problems adding a button to my app using relative layout.When I use the graphical layout tool it shows up when i drag and drop the button but when I compile and run the apk on the emulator only the original 'sms' button is there.The new button should of been to the left of the 'sms' button</p> <p><img src="https://i.stack.imgur.com/rexvk.png" alt="enter image description here"></p> <p>and here's the code from the xml file</p> <pre><code> &lt;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="wrap_content" android:background="#FF000000" &gt; &lt;EditText android:id="@+id/edit_message_input" android:layout_width="match_parent" android:layout_height="100dp" android:hint="@string/edit_message_input" android:inputType="textMultiLine" android:background="#ff000000" android:textColor="#CCCCCC" /&gt; &lt;Button android:id="@+id/button2" android:layout_width="150dp" android:layout_height="40dp" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:layout_marginRight="36dp" android:text="@string/translate_to_english" android:onClick="sendToEnglish" android:background="#CCCCCC" /&gt; &lt;Button android:id="@+id/button1" android:layout_width="150dp" android:layout_height="40dp" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:text="@string/translate_to_text" android:onClick="sendToText" android:background="#CCCCCC" /&gt; &lt;EditText android:id="@+id/editText1" android:layout_width="wrap_content" android:layout_height="100dp" android:layout_above="@+id/button3" android:layout_alignParentLeft="true" android:layout_alignParentRight="true" android:layout_marginBottom="31dp" android:ems="10" android:hint="@string/edit_message_output" android:inputType="textMultiLine" android:background="#ff000000" android:textColor="#CCCCCC" /&gt; &lt;Button android:id="@+id/button3" android:layout_width="150dp" android:layout_height="40dp" android:layout_alignParentBottom="true" android:layout_alignRight="@+id/button2" android:layout_marginRight="22dp" android:background="#CCCCCC" android:onClick="sendSMS" android:text="@string/send_as_sms" /&gt; &lt;!-- test save button --&gt; &lt;Button android:id="@+id/save_word_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:background="#cccccc" android:text="@string/save_word" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p>Any help or pointers much appreciated!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload