【问题标题】:How to implement siyamed's satellite menu?如何实现siyamed的卫星菜单?
【发布时间】:2014-04-13 11:08:43
【问题描述】:

我正在尝试实现 siyamed 的卫星菜单,并且我在整个堆栈中都面临着这个流行的问题,但即使我阅读了所有答案,到目前为止我也无法让它发挥作用。有没有人有其他想法让 id 工作?谢谢!

这里是:

图书馆:

https://github.com/siyamed/android-satellite-menu

这里是:

ma​​in_activity.xml:

<android.support.v4.widget.DrawerLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"

    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
     >

    <!-- The main content view -->

    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        xmlns:sat="http://schemas.android.com/apk/res/android.view.ext"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MainActivity"
        android:background="@drawable/front"
        android:gravity="bottom"
        android:orientation="vertical" >


        <TextView
            android:id="@+id/textView2"
            android:layout_width="150dp"
            android:layout_height="60dp"
            android:layout_marginBottom="21dp"
            android:text="@string/cd"
            android:textSize="15sp"
            android:gravity="center_horizontal"/>
     <TextView
            android:id="@+id/textView1"
            android:layout_width="150dp"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:color="@color/white"
            android:textSize="25sp"
            android:gravity="center_horizontal"/>

            <com.cngcnasaud.orar
        android:id="@+id/menu"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|right" 
        android:layout_margin="8dp"
        sat:satelliteDistance="170dp"
        sat:mainImage="@drawable/ic_launcher"
        sat:totalSpacingDegree="90"
        sat:closeOnClick="true"
        sat:expandDuration="500"/>





    </LinearLayout>

    <!-- The navigation drawer -->

    <ListView
        android:id="@+id/drawer"
        android:layout_width="300dp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:background="@drawable/sdb"
        android:choiceMode="singleChoice"
        android:divider="@android:color/black"
        android:dividerHeight="0dp"
        android:textColor="@android:color/white"
         />






</android.support.v4.widget.DrawerLayout>

错误是:

Multiple annotations found at this line:
    - error: No resource identifier found for attribute 'satelliteDistance' in package 
     'android.view.ext'
    - error: No resource identifier found for attribute 'mainImage' in package 'android.view.ext'
    - error: No resource identifier found for attribute 'closeOnClick' in package 
     'android.view.ext'
    - error: No resource identifier found for attribute 'expandDuration' in package 
     'android.view.ext'
    - error: No resource identifier found for attribute 'totalSpacingDegree' in package 
     'android.view.ext'

【问题讨论】:

    标签: android menu android-support-library satellite


    【解决方案1】:

    改变

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

    到

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

    这应该可行,但对我有用。

    【讨论】:

      【解决方案2】:

      在你的 main_activity.xml 中替换这一行:

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

      有了这个:

       xmlns:sat="http://schemas.android.com/apk/res/<your_package_name>
      

      【讨论】:

        【解决方案3】:

        试试这个..

        我认为您已将 satellite-menu 库重命名为其他库。删除库并申请。并再次添加该库给应用。这将解决。

        右键单击您的项目并单击属性,您可以在单击 Android 屏幕中看到对话框,如下图所示。

        单击红色标记的从右侧删除按钮,然后单击添加按钮选择重命名的库。单击应用并确定错误将得到解决,

        希望这会有所帮助。,

        【讨论】:

          【解决方案4】:

          将以下内容添加到您的命名空间

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

          然后代替 sat: 使用 app: (i.e. sat:satelliteDistance --> app:satelliteDistance)

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 2016-08-14
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 2011-12-28
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多