1

私はgithubでこのライブラリプロジェクトを使おうとしています:

https://github.com/pakerfeldt/android-viewflow

このAndroidライブラリプロジェクトは、水平方向にスワイプします。

このライブラリをどのように使用しようとしているのかを説明します。

  1. このプロジェクトをgithubからダウンロードし、「ExistingProjectsintoWorkspace」を含む「viewflow」プロジェクトをインポートしました。(Eclipseでいくつかのエラーが発生しますが、修正しました。問題ではありません。)
  2. 「test」という名前の新しいAndroidプロジェクトを作成しました。
  3. テストプロジェクトのビルドパスにviewflowプロジェクトを追加しました。(Javaビルドパス->プロジェクト->追加を使用)
  4. これが私のmain.xmlです:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res/com.example.test"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <LinearLayout
        android:id="@+id/header_layout"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal"
        android:orientation="vertical" >

        <org.taptwo.android.widget.TitleFlowIndicator
            android:id="@+id/viewflowindic"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dip"
            app:clipPadding="5dp"
            app:footerColor="#FFFFC445"
            app:footerLineHeight="2dp"
            app:footerTriangleHeight="10dp"
            app:selectedColor="#FFFFC445"
            app:selectedSize="12dp"
            app:textColor="#FFFFFFFF"
            app:textSize="11dp"
            app:titlePadding="10dp" >
        </org.taptwo.android.widget.TitleFlowIndicator>
    </LinearLayout>

    <org.taptwo.android.widget.ViewFlow
        android:id="@+id/viewflow"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:duplicateParentState="true" >
    </org.taptwo.android.widget.ViewFlow>
</LinearLayout>

しかし、Eclipseはこれらのエラーを出します:

Description Resource    Path    Location    Type
R cannot be resolved to a variable  Main.java   /test/src/com/example/test  line 14 Java Problem
R cannot be resolved to a variable  Main.java   /test/src/com/example/test  line 19 Java Problem
error: No resource identifier found for attribute 'titlePadding' in package 'com.example.test'  main.xml    /test/res/layout    line 15 Android AAPT Problem
error: No resource identifier found for attribute 'textSize' in package 'com.example.test'  main.xml    /test/res/layout    line 15 Android AAPT Problem
error: No resource identifier found for attribute 'textColor' in package 'com.example.test' main.xml    /test/res/layout    line 15 Android AAPT Problem
error: No resource identifier found for attribute 'selectedSize' in package 'com.example.test'  main.xml    /test/res/layout    line 15 Android AAPT Problem
error: No resource identifier found for attribute 'selectedColor' in package 'com.example.test' main.xml    /test/res/layout    line 15 Android AAPT Problem
error: No resource identifier found for attribute 'clipPadding' in package 'com.example.test'   main.xml    /test/res/layout    line 15 Android AAPT Problem
error: No resource identifier found for attribute 'footerColor' in package 'com.example.test'   main.xml    /test/res/layout    line 15 Android AAPT Problem
error: No resource identifier found for attribute 'footerLineHeight' in package 'com.example.test'  main.xml    /test/res/layout    line 15 Android AAPT Problem
error: No resource identifier found for attribute 'footerTriangleHeight' in package 'com.example.test'  main.xml    /test/res/layout    line 15 Android AAPT Problem

サンプルプロジェクト( https://github.com/pakerfeldt/android-viewflow/tree/master/viewflow-example )をインポートしましたが、問題なく動作します。

問題は名前空間にある可能性がありますが、これを修正できませんでした。

4

1 に答える 1

1

app:selectedSize="12dp" この行を削除

于 2013-07-31T07:30:15.147 に答える