Android(安卓)中常见bug 总结
密码形式 EditText 的 Hint 字体显示 异常
EditText password = (EditText) findViewById(R.id.register_password_text);password.setTypeface(Typeface.DEFAULT);password.setTransformationMethod(new PasswordTransformationMethod());
参考:
http://stackoverflow.com/questions/3406534/password-hint-font-in-android
TextView设置ellipsize=”end”省略号后面还有字
android:ellipsize="end" android:maxLines="2"
原因:textview中包含了回车或者html字符
解决办法:
- myText.replaceAll("\\<.*?>","")
或者
- Html.fromHtml(myText).toString())
参考:
http://stackoverflow.com/questions/17131294/strange-issue-with-androidellipsize-end
warning: CRLF will be replaced by LF…..
在git提交的时候出现了这个错误,产生这个问题是因为在windows、Linux和Mac在处理文件换行时的标示符不一致。windows使用CRLF作为结束符,而Linux和Mac使用LF作为结束符。
如果刚从windows转到mac 开发,会遇到此错误,反之,则会出现warning: LF will be replaced by CRLF…..
解决办法:我们可以通过terminal.app 或者cmd 查看自己的git配置
$ git config core.autocrlf
如果显示true,则git会在提交的时候自动帮我们处理换行。可通过如下代码更改设置
$ git config --global core.autocrlf true
路径错误
Error:(1, 0) Your project path contains non-ASCII characters. This will most likely
cause the build to fail on Windows. Please move your project to a different
directory. See http://b.android.com/95744 for details.
This warning can be disabled by using the command line flag
-Dcom.android.build.gradle.overridePathCheck=true, or adding the line
‘com.android.build.gradle.overridePathCheck=true’ to gradle.properties file
in the project directory.
导入或者新建androidstudio项目的时候,路径中包含了中文,去掉中文即可!!
更多相关文章
- Android(安卓)Bluetooth 文件接收路径修改方法
- Android(安卓)Studio 各个依赖包存放目录
- Android(安卓)NDK 配置与打包
- 【实战】android网页源代码查看器
- Android(安卓)出错显示找不到id,但你发现id是存在的
- android官方技术文档翻译——Android(安卓)Lint
- Android(安卓)App安装失败错误总结
- Android判断Intent是否存在,是否可用
- Android项目集成Flutter