简体   繁体   English

如何使EditText具有一定的最大宽度,但不离开屏幕?

[英]How do I make an EditText have a certain maximum width, but not go off the screen?

I'm trying to set up an EditText that has a set width, but if the screen is smaller than this width, does not extend off the screen. 我正在尝试设置一个具有设置宽度的EditText,但是如果屏幕小于此宽度,则不会扩展到屏幕之外。 I've tried a number of variations of layout_width and maxWidth and the like, but to no avail. 我已经尝试过许多layout_width和maxWidth之类的变体,但无济于事。 Any ideas? 有任何想法吗?

I think you can find what you are searching for on Android Developers. 我想您可以在Android Developers上找到要搜索的内容。

Check this link look for section "How to support multiple screens" 检查此链接,查找“如何支持多个屏幕”部分

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何检查我的 editText 字段是否为空并使其转到带有 Button 的新活动? - How do I check if my editText field is empty and make it go to a new activity with a Button? 我怎样才能使列表视图中的edittext数据进入数据库? - How can i make data from an edittext in a listview go into the database? 出现五个随机数后如何让我的屏幕变黑? - How to make my screen go blank after I have five random numbers appear? 如何使Horizo​​ntalScrollView的孩子的孩子具有屏幕的宽度? - How can I make a HorizontalScrollView's child's child have the width of the screen? 如何为微调框提供与EditText相同的宽度? - how do I give my spinner same width as my EditText? 如何遍历字符串以确保仅在某些位置包含数字? - How do I go through the String to make sure it only contains numbers in certain places? 如何让动图 go 掉屏并让它重新出现 - How to make a moving picture go off the screen and make it come back again 如何以编程方式使Liferay Portlet进入全屏模式 - How do I programatically make a Liferay Portlet go into Full Screen Mode Java,Swing:如何设置JTextField的最大宽度? - Java, Swing: how do I set the maximum width of a JTextField? 如何使用viewHolder使listView用户输入在屏幕滚动时不返回默认值 - How to use viewHolder to make listView user input not go back to default when scrolling off screen
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM