Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7160747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:26:56+00:00 2026-05-28T13:26:56+00:00

I am using A custom viewpager with a PagerTitleStrip, both supported by the android

  • 0

I am using A custom viewpager with a PagerTitleStrip, both supported by the android compatibility package. As recommended I use it like this:

    <snok.stubefrie.DayPager
    android:id="@+id/viewpager"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1" >

    <android.support.v4.view.PagerTitleStrip
        android:id="@+id/strip"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="top"/>
    </snok.stubefrie.DayPager>

However the titlestrip overlaps with the actual content of my viewpager (Both starting at 0,0). Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T13:26:57+00:00Added an answer on May 28, 2026 at 1:26 pm

    How do you add views to ViewPager?

    When I met the same problem, the cause was to add views with wrong position in my PagerAdapter implementation.

    The bad code was like this.

    viewPager.setAdapter(new PagerAdapter() {
      @Override
      public Object instantiateItem(ViewGroup pager, int position) {
        View view = createView(position);
        ((ViewPager) pager).addView(view, position);
        return view;
      }
      @Override
      public void destroyItem (ViewGroup pager, int position, Object view) {
        ((ViewPager) pager).removeViewAt(position);
      }
      ...
    });
    

    This code had been working, however, when I began to use PagerTitleStrip, the PagerTitleStrip view became the first child of the ViewPager, hence addView(view, 0) broke the internal structure of the ViewPager.

    It was fixed by replacing addView and removeView as below.

    • addView(view, position) -> addView(view)
    • removeViewAt(position) -> removeView((View) view)

    Hope it helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using custom model binder in ASP.NET MVC 2 that looks like this:
I'm having a problem using custom components at runtime. I have this custom FlowLayoutPanel
Currently I am using custom made Java search engine. This Java engine uses Lucene
I am using custom javascript functions provided at this link (http://km0.la/js/mozXPath/) to implement particular
I am using a google maps custom control. I would like a text link
I am using custom bullet points on a website. Now this site will also
Whats the use of using custom comparers in Linq queries? Are they beneficial or
I am using custom fields in Wordpress to contain an 'RRP' currency value. This
When using custom template for Login control , if we add control with ID
When using custom assemblies in a visual studio project. How does one check in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.