【问题标题】:Android Studio requiring layout_width/height within <wallpaper> tagAndroid Studio 需要 <wallpaper> 标签内的 layout_width/height
【发布时间】:2014-03-25 06:13:05
【问题描述】:

Android 工作室坚持我的标签中需要 layout_width 和 layout_height。我很确定他们不是来自阅读here。我试图弄清楚这是由于我的一些错误还是一个奇怪的 Android Studio 怪癖。

我的布局文件:

<?xml version="1.0" encoding="utf-8"?>
<wallpaper xmlns:android="http://schemas.android.com/apk/res/android"
android:thumbnail="@drawable/icon"
android:description="@strings/description"/> 

我的清单的一个 sn-p:

<service android:name="com.handmade.tavern.LiveWallpaper"
    android:label="@string/app_name"
    android:permission="android.permission.BIND_WALLPAPER">
    <intent-filter>
        <action android:name="android.service.wallpaper.WallpaperService"/>
    </intent-filter>
    <meta-data android:name="android.service.wallpaper"
         android:resource="@layout/wallpaper_layout"/>
</service>

有没有其他人经历过这种情况?谁能解释我的错误? 谢谢,

【问题讨论】:

    标签: android xml android-studio live-wallpaper


    【解决方案1】:

    好吧,Android Studio 似乎只允许 res/xml 目录中的标签。只需移动文件即可解决问题。我不确定 Android Studio 是否挑剔。我之前看过两个对存储在 res/layout 文件夹中的壁纸的引用,但我不知道它们是否是拼写错误。欢迎更多的cmets。

    【讨论】:

      猜你喜欢
      • 2015-04-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-14
      相关资源
      最近更新 更多