這裏是我的佈局是這樣的:我的ViewPagerIndicator在哪裏?
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.viewpagerindicator.LinePageIndicator
android:id="@+id/titles"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_below="@id/pager"
android:background="#808080"/>
</RelativeLayout>
和我的onCreate()基礎上的示例代碼片段在網站上:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
pager = (ViewPager) findViewById(R.id.pager);
adapter = new ScreenSlideAdapter(getSupportFragmentManager());
pager.setAdapter(adapter);
lineIndicator = (LinePageIndicator)findViewById(R.id.titles);
lineIndicator.setViewPager(pager);
}
當我運行的應用程序,該指示燈不可見。我究竟做錯了什麼 ?
是否奏效? –
是的,它確實工作。你在這裏改變了什麼?另外,我怎樣才能使指標略大? –