【我的Android进阶之旅】Android Studio如何轻松整理字符串到string.xml中
使用Android Studio一段时间了,还有很多小技巧没有掌握。比如:平常将字符串整理到string.xml中,都是手动的去复制字符串到string.xml中,然后再回来修改引用该字符串的代码,这样很low.今天发现了一个小技巧可以轻松整理字符串到string.xml中,在这里分享出来。 1、在布局文件中写的字符串,整理到string.xml中 1、如下面的布局文件,一般写布局文件的时候都是直接把字符串写到里面,之后再整理到string.xml中: < TextView android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:text = "测试Alt+Enter" android:maxLines = "1" android:textSize = "36sp" /> 来源: oschina 链接: https://my.oschina.net/u/4353702/blog/4527724