我无法使用 circlepageindicator 加载页面。这是xml
<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>
文件
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);
}
jake wharton 项目已添加到库中。它在构建时没有给出任何错误,但没有加载页面。怎么了?