円ページをcirclepageindicatorで読み込めません。これは、XMLAndroid CirclePageIndicatorが機能しない
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
MyPagerAdapter adapter=new MyPagerAdapter();
ViewPager myPager=(ViewPager)findViewById(R.id.myfivepanelpager);
myPager.setAdapter(adapter);
myPager.setCurrentItem(2);
CirclePageIndicator titleIndicator = (CirclePageIndicator)findViewById(R.id.indicator);
titleIndicator.setViewPager(myPager);
}
ジェイクのウォートンプロジェクトがライブラリに追加されました
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView android:src="@drawable/bg2" android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout android:layout_width="220dp"
android:orientation="vertical" android:layout_gravity="center_horizontal"
android:layout_height="32dp" android:layout_marginTop="32dp">
<android.support.v4.view.ViewPager
android:layout_width="match_parent" android:layout_height="match_parent"
android:id="@+id/myfivepanelpager" />
<com.viewpagerindicator.CirclePageIndicator
android:id="@+id/indicator"
android:padding="10dip"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
/>
</LinearLayout>
javaファイルです。それはビルド中にエラーを出すことはありませんが、ページをロードしません。どうしましたか?
そのないcirclepageindicatorが欠落していることを、ページ自体がロードされていません。再びそれは予期せず停止した。 – JaseemAmeer
私はjava buildpathにurライブラリプロジェクトを追加しました。しかし、circlepageindicatorはxmlのデザインでgreyboxで表示されます。 – JaseemAmeer
Javaのビルドパスではなく、「Android」設定でライブラリプロジェクトとして追加する必要があります。 –