我在我的应用中使用了AndroidImageSlider(https://github.com/daimajia/AndroidImageSlider),但我无法在页面指示器中应用自定义设计。我使用Eclipse,我下载了proyect并添加为库
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:id="@+id/viewFlipper"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:addStatesFromChildren="true"
android:background="@color/azul_us"
android:orientation="vertical" >
<com.daimajia.slider.library.SliderLayout
android:id="@+id/slider"
android:layout_width="match_parent"
android:layout_height="200dp" />
<com.daimajia.slider.library.Indicators.PagerIndicator
android:id="@+id/custom_indicator"
style="@style/AndroidImageSlider_Magnifier_Oval_Black" />
</LinearLayout>
<style name="AndroidImageSlider_Magnifier_Oval_Black">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:gravity">right</item>
<item name="android:paddingLeft">2dp</item>
<item name="android:paddingRight">2dp</item>
<item name="shape">rect</item>
<item name="padding_left">3dp</item>
<item name="padding_right">3dp</item>
<item name="padding_top">4dp</item>
<item name="padding_bottom">4dp</item>
<item name="selected_color">#7ac943</item>
<item name="unselected_color">#33000000</item>
<item name="selected_width">8dp</item>
<item name="selected_height">8dp</item>
<item name="unselected_width">6dp</item>
<item name="unselected_height">6dp</item>
</style>
感谢!!!!!
答案 0 :(得分:0)
我忘了添加这一行
slider.setCustomIndicator((PagerIndicator) findViewById(R.id.custom_indicator));