I want to have an edittext and button fill screen horizontally. When I have this configuration :
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:id="@+id/et_word"
android:padding="10dp"
/>
<requestFocus/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:id="@+id/btn_word"
android:text="@string/send"
android:padding="10dp"
/>
</LinearLayout>
When I have this configuration :
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:id="@+id/et_word"
android:padding="10dp"
/>
<requestFocus/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:id="@+id/btn_word"
android:text="@string/send"
android:padding="10dp"
/>
</LinearLayout>
I guess in second configuration, edittext really fills parent but button is not visible. How can I change my code so that both edittext and button would fill screen horizontally? Thanks.