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

标签 android android-layout xamarin mono

第一次使用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/

相关文章:

android - 如何更改 Android 中操作栏的高度?

android - Android 5.1 上的 Adreno 420 驱动程序错误

java - 如何使用套接字将移动应用程序从您的 Android 移动设备连接到您的笔记本电脑服务器?

visual-studio - Windows 手机模拟器无法正常工作(visual studio 更新 3)?

android - 为什么关闭我的android程序不会关闭?

android - 布局加载缓慢

android - RecyclerView 未显示在协调器布局中

android - 如何连接删除按钮以删除 ListView 中的一个项目?

c# - FontButton 字体更改不起作用

java - Xamarin KeyStore 密码保护字段