Android:翻译属性隐藏了EditText的底部边界



i" m使用textInput layouout来获取用户信息和内部的deDittext。我将背景用作四边的边框的形状。

我面临着一个提示用Edittext边界切断文本的问题,因此搜索解决方案并声明 android:translationY="10dp" 在XML中做到了。但是现在,底部边框是看不见的,只有顶部,右,左边框才能宣布该属性。

我该如何修复。

这是我的XML布局。

 <android.support.design.widget.TextInputLayout
                app:hintTextAppearance="@style/MobileText"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:clipChildren="false">
                <EditText
                    android:id="@+id/availaible_location"
                    android:layout_width="match_parent"
                    android:layout_height="90dp"
                    android:layout_marginTop="20dp"
                    android:background="@drawable/edit_text"
                    android:hint="Satdobato, Thimi, Balkhu..."
                    android:cursorVisible="true"
                    android:gravity="top"
                    android:padding="5dp"
                    android:inputType="textShortMessage|textMultiLine"
                    android:textAppearance="?android:attr/textAppearanceSmall"
                    android:textCursorDrawable="@null"
                    android:translationY="10dp"
                    />
            </android.support.design.widget.TextInputLayout>

和我的背景edit_txt.xml布局是

<?xml version="1.0" encoding="utf-8"?>
 <selector xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="wrap_content"
    android:layout_width="wrap_content">
    <item>
        <shape android:shape="rectangle">
            <solid android:color="#ffffff"/>
            <corners android:radius="5dp" />
            <stroke
                android:width="2dp"
                android:color="#949494"
                />
        </shape>
    </item>
</selector>

将textInputlayout的layout_height更改为" 112dp"。您移动的deDittext 10dp沿y方向。textInputlayout具有wrap_content,因此editext隐藏在textInputlayout中。

android:layout_height =" 112dp"

尝试添加您的编辑文本:

android:paddingLeft="10dp"
android:paddingRight="10dp" 

您需要进行填充并删除de翻译,必须使用该值。如果问题仍然存在,请尝试做:

android:padding="10dp" 

我希望它对您有帮助!

最新更新