Xamarin.Android-版式设计器空白 [英] Xamarin.Android - layout designer blank

查看:65
本文介绍了Xamarin.Android-版式设计器空白的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天我打开一个项目,发现它的布局都不会在设计器中呈现.

Today I opened a project to find that none of its layouts will render in the designer.

我很确定这不是我的AXML的问题,因为该应用程序在构建时可以正常运行.Visual Studio是最新版本(15.9.9),将在其他项目中显示布局而不会出现问题.我的布局位于正确的位置(资源/布局).我已经尝试过-

I am pretty sure it is not an issue with my AXML as the app works fine when built. Visual Studio is up to date (15.9.9) and will display layouts in other projects without issue. My layouts are in the correct location (Resources/layout). I have tried -

  • 清洁和重建
  • 手动删除bin/obj文件夹并重建项目
  • 在Options/Xamarin/Android UI Designer中打开/关闭加速渲染
  • 在Visual Studio for Mac(7.8)中打开项目-相同的问题
  • 重新启动Visual Studio/重新启动计算机

任何有关解决此问题的想法将不胜感激.我不确定来源的哪一部分对回答这个问题有帮助,所以请提出,我会提供.

Any ideas on how to fix this would be greatly appreciated. I am not sure what part of the source would be useful to help with answering this question so please ask and I will provide.

注意-该项目位于TFS上.

推荐答案

我发现此问题是由将应用程序的目标框架版本设置为Android 9.0引起的.将此值设置为8.0以匹配设计者使用的版本即可解决此问题.

I found that the issue was caused by the target framework version of the app being set to Android 9.0. Setting this to 8.0 to match the version used by the designer fixed the issue.

我需要目标框架为9.0版,但我不知道如何将版本添加到设计器中(8.0是我唯一可用的版本).我对此提出了另一个问题(请参阅此处).

I need the target framework to be version 9.0 and I can't figure out how to add versions to the designer (8.0 is the only one available to me). I have asked another question in regards to this (see here).

这篇关于Xamarin.Android-版式设计器空白的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆