android开发 Edittext编辑框超出屏幕
来源:互联网 发布:云天明 知乎 编辑:程序博客网 时间:2024/06/04 18:12
今天导入一段别人写的计算器源码,运行后发现编辑框里的数字有一部分在屏幕外面,如下图所示:
但是我的布局设置的是match parent,无法理解为什么会出现这种情况。
<EditText android:id="@+id/result"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:drawable/editbox_background"
android:layout_span="4"
android:textSize="48sp"
android:gravity="right|center_vertical"
android:cursorVisible="false"
android:editable="true"
android:lines="1" />
后来我进入到Graphical layout中预览,发现也是这种情况,如下图所示:
后来将Api22调到Api17,发现Graphical layout中预览的编辑框终于不超出屏幕外了:
自此,我以为问题解决了。运行程序结果编辑框还是在屏幕外。百撕不得骑姐。。
后来尝试无数次,最后在加入layout_weight属性才终于解决问题,什么原因现在还不清楚。
<EditText android:id="@+id/result"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:drawable/editbox_background"
android:layout_span="4"
android:textSize="48sp"
android:gravity="right|center_vertical"
android:cursorVisible="false"
android:editable="true"
android:lines="1"
android:layout_weight="1" />
- android开发 Edittext编辑框超出屏幕
- GridLayout,子控件EditText内容超出屏幕
- GridLayout,子控件EditText内容超出屏幕
- Android 解决TableRow中TextView或Edittext超出屏幕,不能自动换行或换行问题
- Android开发,超出屏幕范围的控件显示解决办法
- Android开发解决控件超出屏幕,不显示问题
- android TextView超出屏幕加“...”
- Android 编辑框(EditText)属性
- Android之编辑框(EditText)控件
- Android UI控件详解-EditText(编辑框)
- Android复习之编辑框EditText
- Android 编辑框(EditText)属性学习
- Android 编辑框(EditText)属性学习
- Android 输入法导致EditText编辑框问题
- Android学习笔记(18):编辑框EditText
- Android EditText 编辑框的使用
- Android 编辑框(EditText)属性学习
- android edittext编辑框光标改变事件
- 杭电ACM2037java做法
- arm指令中mov和ldr的区别
- C/C++校招笔试面试经典题目总结九
- iOS开发-Day12-C的复习
- ios 常用的正则表达式
- android开发 Edittext编辑框超出屏幕
- Mycat ERROR 1064 (HY000): bad insert sql
- spring中各个jar包的作用
- java工作半年总结(反射)
- C++静态成员与函数
- 搭建SSH框架顺序和注意事项
- 错误:Unsupported major.minor version 51.0(jdk版本错误)
- 配置spring文件时候出现的小问题
- Android 签名+混淆( 签名+proguard.cfg)