【问题标题】:The 'http://schemas.android.com/apk/res/android:layout_centerInParent' attribute is not declared未声明“http://schemas.android.com/apk/res/android:layout_centerInParent”属性
【发布时间】:2017-04-03 05:32:54
【问题描述】:

我在 Xamarin 为 Android 编程。 我试图在相对布局中居中进度条。但是我收到了这条消息:'http://schemas.android.com/apk/res/android:layout_centerInParent' 属性未声明。

看下面的代码:

    <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="35"
            android:minWidth="25px"
            android:minHeight="25px">
            <ProgressBar
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/progressBar1"
                android:layout_centerInParent="true" />
        </RelativeLayout>

有人可以帮助我吗?

【问题讨论】:

    标签: android xml android-layout xamarin


    【解决方案1】:

    您的布局文件缺少 android xml 命名空间。 在布局中添加 xmlns:android 属性

    xmlns:android="http://schemas.android.com/apk/res/android
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-07-31
      • 1970-01-01
      • 1970-01-01
      • 2019-01-17
      • 2016-11-04
      • 2017-09-28
      • 2013-12-07
      相关资源
      最近更新 更多