2012-05-29 14 views
12

में सामने के लिए सर्किल पेज इंडिकेटर कैसे लाया जाए मेरे पास व्यू पेजर गैलरी और दृश्य के नीचे एक सर्कल पेज सूचक है। मैं पेज पेजर के सामने पेज संकेतक लाना चाहता हूं और इसे आईफोन छवि गैलरी में जितना संभव हो, इसे पारदर्शी बनाना चाहता हूं। क्या आपको कोई विचार है कि इसे कैसे करें?एंड्रॉइड

enter image description here

समाधान:

यहाँ समाधान के रूप में xml कोड है। @sanna

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:background="#000000"> 


<android.support.v4.view.ViewPager 
    android:id="@+id/gallery_view" 
    android:layout_height="fill_parent" 
    android:layout_width="fill_parent" 
    /> 

<com.viewpagerindicator.CirclePageIndicator 
    android:id="@+id/indicator" 
    android:padding="10dip" 
    android:layout_height="wrap_content" 
    android:layout_width="fill_parent" 
    android:layout_alignParentBottom="true" 
    /> 
</RelativeLayout> 

और यहां मेरी गैलरी की नई उपस्थिति है।

enter image description here

+0

क्या आप छविदृश्य के लिए कोड साझा कर सकते हैं ?? – kgandroid

+0

@kgandroid छवि दृश्य ViewPager के अंदर है। इसके बारे में कुछ खास नहीं है, बस पूर्ण स्क्रीन ImageView। – osayilgan

उत्तर

17

मैं अपने पेजर पहले पूरे दृश्य को कवर करने के साथ RelativeLayout का प्रयोग करेंगे और उसके बाद के साथ parentAlignBottom = सच सूचक दृश्य जोड़ने।

+1

उत्तर के लिए धन्यवाद। यह काफी अच्छी तरह से काम करता है। आप समाधान के रूप में अपना संपादन भी देख सकते हैं। – osayilgan