Xamarin, Visual Studio 2015 - AXML Designer loadin

2020-06-28 20:08发布

I try to edit an axml file in Visual Studio, because drag and drop doesn't work in Xamarin Studio. But when I open my axml file, it's loading forever.

I've been waiting for more than 10 minutes, but it is still loading. When I restart VS I can open the axml file without any problems.

The same applies for all my other axml files (in other projects).

Does anyone knows how to fix this?

I'm using the newest stable version(cycle 8) of Xamarin btw.

EDIT:

I'm using Visual Studio Community 2015 Version 14.0.25425.01 Update 3 and I've got all the latest updates installed.

More detailed explanation:

  1. I open my project in Visual Studio
  2. I open my foo_bar.axml file
  3. I switch from the Designer tab to the Source tab
  4. I remove the android:background="blablabla" attribute
  5. I switch from the Source tab to the Designer tab
  6. The Designer tab is loading forever

AND

  1. I open my project in Visual Studio
  2. I open my foo_bar.axml file
  3. I make some changes
  4. I close the foo_bar.axml file
  5. I reopen the foo_bar.axml file
  6. the foo_bar.axml file is loading forever

NOTE:

The problem doesn't happen when I change the android:text="blablabla" attribute at step 4 and when I change some other attributes it also doesn't happen, so it is specific to just some attributes.

3条回答
趁早两清
2楼-- · 2020-06-28 20:29

According to a forumer at Xamarin Forums, it has something to do with Cycle 8's AXML Designer not being able to render using the newest API.

But even in Cycle 8 when I choose to compile under Android 6.0 instead of 7.0 in the project's properties, the designer is still wonky as it is. Switch between "Designer" and "Source" on one .axml file and the designer still loads until Harambe cometh.

Therefore, your best bet is to downgrade Xamarin Studio to Cycle 7, and you can finally get the AXML Designer as working as before. Until Cycle 9 or an incremental update/hotfix of Cycle 8 comes about, this is the way to go for now. You can download and install the previous cycle in the link below: https://store.xamarin.com/account/my/subscription/downloads#cycle7

For your own interest, you can read more about the aforementioned forum thread below: https://forums.xamarin.com/discussion/77992/axml-layout-designer-inside-visual-studio-keeps-loading-forever

查看更多
疯言疯语
3楼-- · 2020-06-28 20:29

This happened to me also. Then I realised I hadn't opened Visual Studio in Admin mode. After I did, everything was fine.

查看更多
做个烂人
4楼-- · 2020-06-28 20:39

Open the visual studio as admin and it loads perfectly. All the best.

查看更多
登录 后发表回答