Android问题集锦

android:screenOrientation属性

在开发android的应用中,有时候需要限制横竖屏切换。只需要在AndroidManifest.xml文件中加入android:screenOrientation属性限制。
android:screenOrientation="landscape"是限制此页面横屏显示
android:screenOrientation="portrait"是限制此页面数竖屏显示

Read More

res与res-auto的区别

通常我们在布局文件中使用自定义属性的时候会这样写:
xmlns:app="http://schemas.android.com/apk/res/包路径"

但如果你当前工程是做为lib使用,那么你如上所写,会出现找不到自定义属性的错误。
这时候你就可以写成:
xmlns:app="http://schemas.android.com/apk/res-auto"

Read More