How to set a dialog themed activity width to screen width?
Posted
by Pentium10
on Stack Overflow
See other posts from Stack Overflow
or by Pentium10
Published on 2010-06-02T21:43:03Z
Indexed on
2010/06/02
21:44 UTC
Read the original article
Hit count: 264
android
|android-sdk
I am followin the method described here to create an EditText input activity. But the view doesn't fill the width of the screen. How can I tell to fit the screen width?
<activity android:name="TextEntryActivity"
android:label="My Activity"
android:theme="@android:style/Theme.Dialog"/>
-
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:orientation="vertical"
android:gravity="right"
android:layout_height="wrap_content">
<EditText
android:text="@+id/txtValue"
android:id="@+id/txtValue"
android:layout_width="fill_parent"
android:layout_height="wrap_content"></EditText>
<Button
android:text="Done"
android:id="@+id/btnDone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></Button>
</LinearLayout>
© Stack Overflow or respective owner