背景的EditText图像填充母 [英] EditText background image fills parent

查看:121
本文介绍了背景的EditText图像填充母的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的EditText 看法是这样的:

<EditText 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:inputType="none"
    android:background="@drawable/writting_field"
    android:text="@string/test" />

但它延伸并填充父。有什么问题?

But it stretches and fills parent. What is the problem?

推荐答案

如果图像尺寸等于或大于父更大会自动采取那么多的大小,把它固定高度宽度要么你必须给它固定的高度宽度DP或尝试用EMS的EditText选项。

If image size is same or bigger than parent it will automatically takes that much size , to take it fixed height width either you have to give it fixed height width in dp or try with ems option in edittext .

这篇关于背景的EditText图像填充母的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆