Android Studio Designer displaying widgets & fragments differently than my phone

断了今生、忘了曾经 提交于 2019-12-02 09:20:59

The designer/emulator use the official frameworks of android, while Some mobile device manufacturer may modify some appearance of widgets in frameworks, so the "View" you see in designer may be different from what you see in real devices, even different devices have different appearance for some widgets.

Support the real device have not modified widgets appearance in frameworks, then you can expect them have the same appearance with designer/emulator. One thing to notice, Android studio designer renders "Views" using some theme, you can specify the theme using "tools:context" attribute or select one in options, for example:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="horizontal"
          tools:context=".MainActivity"/>

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!