Im无法使用circlepageindicator加载页面。这是XMLAndroid CirclePageIndicator无法正常工作
<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文件
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);
}
杰克沃顿商学院项目已被添加到库中。它不会在构建时给出任何错误,但不会加载页面。怎么了?
它不是该circlepageindicator丢失,网页本身没有加载。它再次意外停止。 – JaseemAmeer 2012-04-02 05:48:03
我已经在java buildpath中添加了ur库项目。但是在xml的设计中,circlepageindicator仍然显示在灰色框中。 – JaseemAmeer 2012-04-02 05:58:53
您必须将其添加为“Android”设置下的库项目,而不是通过Java构建路径。 – 2012-04-02 19:18:19