gpt4 book ai didi

android - 无法在 Xamarin Studio 中加载 Main.axml

转载 作者:行者123 更新时间:2023-11-30 02:04:18 24 4
gpt4 key购买 nike

第一次使用Xamarin。

我无法在内容选项卡中打开 Main.axml 以修改应用程序 View 。

我只能在源标签中显示它。

错误消息是“无法加载布局:操作因内部错误而失败:com.android.ide.common.rendering.api.SessionParams.(Lcom/android...

有谁知道如何修复它。

谢谢大家的帮助,

最佳答案

认为格式略有偏差,试试这个:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/myButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
</LinearLayout>

改变步骤:

  1. 去掉xmlns:android="schemas.android.com/apk/res/android"
  2. 末尾的分号
  3. xmlns:android="schemas.android.com/apk/res/android" 更改为xmlns:android="http://schemas.android.com/apk/res/android" - 认为删除“http://”可能只是 StackOverflow 评论的格式
  4. 最后将 layout_widthlayout_height 中的 "fill_parent" 更改为 "match_parent"区别here

关于android - 无法在 Xamarin Studio 中加载 Main.axml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30954849/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com