panpf / pager-indicator

这是 Android 上的一个 ViewPager 页面指示器组件,用于标识当前显示的页面
139 stars 49 forks source link

Cannot see the tab indicator #2

Open parin9097 opened 10 years ago

parin9097 commented 10 years ago

Hello. Functionality works absolutely fine but i cannot see the tab indicator. what is the reason behind it? please help me. Thanks in advance.

panpf commented 10 years ago

Thank you very much for your patronage, you have to put your code, I can help you.

parin9097 commented 10 years ago

package main.java.me.xiaopan.android.pagerslidingtabstrip.sample;

import java.util.ArrayList; import java.util.List; import java.util.Random;

import main.java.me.xiaopan.android.pagerslidingtabstrip.PagerSlidingTabStrip; import main.java.me.xiaopan.android.pagerslidingtabstrip.R; import android.annotation.SuppressLint; import android.annotation.TargetApi; import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.support.v4.view.ViewPager; import android.view.Menu; import android.view.MenuItem; import android.view.View;

/**

parin9097 commented 10 years ago

And xml file is exactly same as per you documentation of the library in github.

panpf commented 10 years ago

How much chinese you speak

parin9097 commented 10 years ago

I can't speak actually i translate the language in translator.

panpf commented 10 years ago

You put your APP source code to me I see

panpf commented 10 years ago

If possible, please send to my mailbox sky@xiaopan.me

parin9097 commented 10 years ago

The code above is my app source code and all other are class files like Colors.java and ViewPagerAdapter file and the package with this main.java.me.xiaopan.android.pagerslidingtabstrip and in this package PagerSlidingTabStrip.java file.

parin9097 commented 10 years ago

Hello , i solved the previous issue but now i stuck in other problem. how can i get the click of particular tab and as per the click i can navigate to particular activity?

panpf commented 10 years ago

You can register to listen for events by setOnClickTabListener method

parin9097 commented 10 years ago

Thank you.it works fine.now how can i work with it like tabs . like opening a new activity like we can click on tabs

panpf commented 10 years ago

Sorry, I don't understand your needs, and therefore can not understand you do so

parin9097 commented 10 years ago

"https://play.google.com/store/apps/details?id=com.myntra.android". This is the link of myntra application. i want to achieve exactly same as per this app. thing which can be done on click of tabs.i want to implement that thing. please help me and install this app. Thank you for your cooperation.

panpf commented 10 years ago

Are you worried about not by clicking on the TAB switch to ViewPaeer?

parin9097 commented 10 years ago

Yes exactly i want to achieve this thing. device-2014-08-29-114729

On click of these tabs i want to open their layouts in viewpager.

Thanks.

panpf commented 10 years ago

You need to call pagerSlidingTabStrip.setViewPager(viewPager) method to bind the ViewPager, PagerSlidingTabStrip will monitor the TAB Click events and ViewPager switching

parin9097 commented 10 years ago

yes i know that but how can i set my layout in viewpager and can flip the layouts in viewpager

panpf commented 10 years ago

You can't use ViewPager?

parin9097 commented 10 years ago

i used viewpager for it

panpf commented 10 years ago

You don't know how to use ViewPager?

parin9097 commented 10 years ago

I know and i can used it in many projects but cannot open actvities like this so that it irritates me.

panpf commented 10 years ago

You want to put Activity in ViewPager?

parin9097 commented 10 years ago

Yes i want to put activity in viewpager

panpf commented 10 years ago

Activity cannot be placed in the ViewPager. But Fragment and View can be placed in the ViewPager

parin9097 commented 10 years ago

how to put the fragment in viewpager?

panpf commented 10 years ago

Which country do you come from?

parin9097 commented 10 years ago

I am from india . and you are from?

panpf commented 10 years ago

china

parin9097 commented 10 years ago

can you help me please?

panpf commented 10 years ago

You need to learn how to use the Fragment, recommended Android official tutorial http://developer.android.com/training/basics/fragments/index.html

parin9097 commented 10 years ago

Thank you very much

panpf commented 10 years ago

You're welcome

parin9097 commented 10 years ago

Hey thanks for your great cooperation. i achieve the thing i want. thank you,.

amir202000 commented 9 years ago

I have a ViewPager, and FragmentPagerAdpater and 3 Fragments to implement an tab swipe view. Is the ViewPager supposed to "remember" the 3 views after first time rendering?

My problem is that after some time, the layouts of the 3 views are "forgotten". That means I need to update them again and user will see the ugly part before updating.

Is there a view holder pattern for viewpager as well? What technique can i use to remain those already rendered views or preventing them being destroyed?

panpf commented 9 years ago

call ViewPager.setOffscreenPageLimit(3)