user565447
user565447

Reputation: 999

EditText doesn't fill the whole height of the window

EditText doesn't fill the whole height of the window. Here is the code:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

    android:id="@+id/LinearLayout01"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

        <LinearLayout android:id="@+id/LinearLayout02"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        >

            <Button android:id="@+id/bItalic"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                ></Button>

            <Button android:id="@+id/bBold"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                />

            <Button android:id="@+id/bUnderline"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                />

            <Button android:id="@+id/bStrike"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="S"
                />

            <Button android:id="@+id/bSub"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                />

            <Button android:id="@+id/bSup"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                />

            <ImageButton 
                android:id="@+id/bInsertImage"
                android:src="@drawable/insertimage"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"/>

            <ImageButton 
                android:id="@+id/bInsertTable"
                android:src="@drawable/table"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"/>

        </LinearLayout>


        <FrameLayout
            android:id="@+id/FrameLayout02"
            android:layout_height="fill_parent"
            android:layout_width="fill_parent"
            >

            <TabHost android:id="@+id/tabhost"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent">
                <TabWidget android:id="@android:id/tabs"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                />
                <FrameLayout android:id="@android:id/tabcontent"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:paddingTop="62px">

                    <ScrollView 
                        android:id="@+id/scroll01" 
                        android:layout_width="fill_parent" 
                        android:layout_height="fill_parent">

                        <HorizontalScrollView 
                            android:id="@+id/scroll_hor01" 
                            android:layout_width="fill_parent" 
                            android:layout_height="fill_parent">
                                <EditText 
                                    android:id="@+id/VisualPane" 
                                    android:layout_width="fill_parent" 
                                    android:layout_height="fill_parent"
                                 />
                        </HorizontalScrollView>
                    </ScrollView>

                    <ScrollView 
                        android:id="@+id/scroll02" 
                        android:layout_width="fill_parent" 
                        android:layout_height="fill_parent">

                        <HorizontalScrollView 
                            android:id="@+id/scroll_hor02" 
                            android:layout_width="fill_parent" 
                            android:layout_height="fill_parent">
                                <EditText 
                                    android:id="@+id/HTMLPane" 
                                    android:layout_width="fill_parent" 
                                    android:layout_height="fill_parent" />  
                        </HorizontalScrollView>
                    </ScrollView>   
                </FrameLayout>
            </TabHost>
        </FrameLayout>

</LinearLayout>

Here is a screenshot: http://s48.radikal.ru/i122/1101/a4/030018887e7b.jpg

Why doesn't EditText fill the whole height of the window?

Upvotes: 1

Views: 2898

Answers (3)

Utyi
Utyi

Reputation: 4604

The width of HorizontalScrollView is the maximum width of its elements, so you can't use fill parent inside there, because the parent's width is undefined, hence it will be 0. What you are looking for - i think - is the android:scrollHorizontally attribute of EditText. Vertically it's scrollable by default (if it's size exceeds the display), so you shouldn't place it inside any ScrollViews. Simply use an EditText with fill parent dimensions, and with scrollHorizontally="true". Also make sure that the LinearLayout containing it also has fill parent height.

Upvotes: 3

TheCottonSilk
TheCottonSilk

Reputation: 8812

Setting following properties helped me to change the size:
android:minHeight="105px"
android:layout_height="115px"
android:layout_width="250px"

Upvotes: -1

Kiril Kirilov
Kiril Kirilov

Reputation: 11257

The parent LinearLayout property

android:layout_height="wrap_content"

must be

android:layout_height="fill_parent"

You can set the following property of the EditText view

android:layout_margin="1dip"

This is a bit of a hack but will work for now.

Upvotes: 2

Related Questions