N
N
Neonoviiwolf2017-05-21 20:15:48
Android
Neonoviiwolf, 2017-05-21 20:15:48

Android why is the background part of the EditText cut off?

Kindly
The picture below is the problem. When I open the layout, the corners from the bottom are rounded, it’s worth pressing enter 2 times, the corners from the bottom are cut off, if you remove the line break, the corners still remain cut off and this is only in this EditText, in all the others there is no such magic and they are all the same, the current size different 1e26a91bb3114bb79f4f28443ea3b48c.png
, that's what I noticed
81a26fbaf77746018e58dd090af0f8b6.png7e851adbd9bd480dbef9d3ff0bba59f6.png
here is the markup code, cut out everything that is possible to make it easier to understand

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:paddingTop="10dp"
              android:paddingLeft="25dp"
              android:paddingRight="25dp"
              android:layout_width="match_parent"
              android:layout_height="match_parent">
    <ScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent">
        <android.support.v7.widget.LinearLayoutCompat
                android:orientation="vertical"
                android:layout_width="match_parent"
                android:layout_height="match_parent">

            <android.support.v7.widget.AppCompatEditText
                    android:background="@drawable/style_edit_text"
                    android:padding="5dp"
                    android:id="@+id/write_name_product"
                    android:hint="@string/addProduct"
                    style="@android:style/TextAppearance.Medium"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"/>

            <android.support.v7.widget.LinearLayoutCompat
                    android:orientation="vertical"
                    android:id="@+id/add_consist"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

   <include layout="@layout/item_add_consist"/>  вот этот include

                <android.support.v7.widget.LinearLayoutCompat
                        android:padding="5dp"
                        android:orientation="vertical"
                        android:id="@+id/layout_recipe"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content">

                    <android.support.v7.widget.AppCompatTextView
                            android:gravity="center_horizontal"
                            android:text="@string/recipe"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"/>
                    <android.support.v7.widget.AppCompatEditText
                            android:background="@drawable/style_edit_text"
                            android:minHeight="150dp"
                            android:padding="5dp"
                            android:id="@+id/write_text_recipe"
                            android:gravity="top"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"/>
                </android.support.v7.widget.LinearLayoutCompat>
                <android.support.v7.widget.AppCompatButton
                        android:id="@+id/button_write_product"
                        android:text="@string/OK"
                        android:layout_centerVertical="true"
                        android:layout_centerHorizontal="true"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"/>
            </android.support.v7.widget.LinearLayoutCompat>
        </android.support.v7.widget.LinearLayoutCompat>
    </ScrollView>
</LinearLayout>

here is include, same thing without it
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.LinearLayoutCompat
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical"
        android:padding="5dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
    <android.support.v7.widget.LinearLayoutCompat
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
        <android.support.v7.widget.AppCompatEditText
                android:layout_gravity="top|left"
                android:background="@drawable/style_edit_text"
                android:id="@+id/text_view_write_name_product"
                android:hint="@string/write_name_product"
                android:layout_weight="1"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>
        <android.support.v7.widget.AppCompatEditText
                android:maxLines="1"
                android:background="@drawable/style_edit_text"
                android:layout_weight="2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>

        <android.support.v7.widget.AppCompatButton
                android:id="@+id/button_add_product"
                android:text="@string/add"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"/>
    </android.support.v7.widget.LinearLayoutCompat>
</android.support.v7.widget.LinearLayoutCompat>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Zagaevsky, 2017-05-21
@zagayevskiy

I think you
1) don't have android::maxLines="1"
2) have android:height="wrap_content"
But it's hard to guess without markup. So you can see that the size has increased and the bottom edge has gone under the next view.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question