Please have a look at the following XML layout
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<TextView
android:id="@+id/lblPassword"
android:text="@string/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<EditText
android:id="@+id/pwdText"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:inputType="textPassword"
/>
<Button
android:text="@string/btnLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="showMessage"
/>
</LinearLayout>
This generates the following gui (attached)

As you can see, the textbox height is unexpectedly too much. Actually what I need is adjusting textbox width to fit to the app properly, providing enough space to type (if I didn’t do anything, the textbox appears very small in width). I am new to android. Please help!
To expand the width to match the width of the device replace
android:layout_width="wrap_content"withandroid:layout_width="match_parent", or you can specify a width in dp.By setting the attributes
android:layout_height="0dp"andandroid:layout_weight="1"you are saying you want this elements height to fill all the remaining space on the screen.