Android开发-Missing styles 解决方案-AndroidStudio

来源:互联网 发布:linux用kill进程的方法 编辑:程序博客网 时间:2024/05/18 07:07

xml切换主题出现Missing styles,最后没能找到直接的解决方案。

例如,下拉选择“Light.NoTitleBar”,就会出现:

  Rendering Problems Missing styles. Is the correct theme chosen for this layout?  Use the Theme combo box above the layout to choose a different layout, or fix the theme style references.   Failed to find '?attr/textEditSuggestionItemLayout' in current theme. (33 similar errors not shown)  Tip: Try to refresh the layout.




在java里,尝试使用:

    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        setContentView(R.layout.activity_main);    }
运行到手机里也没有得到正确的效果。





最后,尝试了一下直接在manifests.xml里进行设置:

        <activity android:name=".MainActivity"            android:theme="@style/Theme.AppCompat.Light.NoActionBar">

效果没有问题。暂时这样解决。

1 2
原创粉丝点击