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 4547198
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:03:37+00:00 2026-05-21T16:03:37+00:00

I required a custom tab-switching view for my application, so i made a .xib

  • 0

I required a custom tab-switching view for my application, so i made a .xib with a UIScrollView and a UITabBar.

I added a ‘ClearChildren’ and a ‘SwitchViews’ method to the UIScrollView like this :

public static class Extensions
{
    #region UIScrollView extensions
    public static void ClearChildren (this UIScrollView scrollViewer)
    {
        foreach(var subview in scrollViewer.Subviews)
        {
            subview.RemoveFromSuperview();
        }
    }

    /// <summary>
    /// switches the content views of a UIScrollView entirely
    /// with for example a tab-bar.
    /// </summary>
    /// <param name="scrollViewer">
    /// A <see cref="UIScrollView"/>
    /// </param>
    /// <param name="newView">
    /// A <see cref="UIView"/>
    /// </param>
    public static void SwitchViews (this UIScrollView scrollViewer, UIView newView)
    {

        scrollViewer.ClearChildren();
        scrollViewer.AddSubview(newView);



        //reset content size
        scrollViewer.ContentSize = new System.Drawing.SizeF(newView.Bounds.Width, newView.Bounds.Height);

    }


    #endregion
}

however, when i switch the views on a UIScrollView using someUiScrollView.SwitchViews(someOtherScrollView)
The UIScrollView suddenly loses its scroll bars and allows both horizontal and vertical scrolling.

how do i make sure the horizontal and vertical scrolling behavior of the UIScrollView do not change, and keep my scrollbars visible?

  • 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-21T16:03:37+00:00Added an answer on May 21, 2026 at 4:03 pm

    The view i was loading turned out to be a little bit wider than the UIScrollView.

    If this could be prevented simply by setting the new view’s width to the bounds of the UIScrollView like so :

    ...
                scrollViewer.ClearChildren();
                newView.Bounds = new System.Drawing.RectangleF(new PointF(0f,0f), new SizeF(scrollViewer.Bounds.Width, newView.Bounds.Height));
                scrollViewer.AddSubview(newView);
    ...
    

    (naturally this means the view can have vertical scrolling only, which is what i wanted in this particular example)

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

Sidebar

Related Questions

What are the specifications for the icons required by Apple for a custom iPhone
I have a WPF application (.NET 3.0, VS2008) that displays data in a tab
I saw here square brackets that are used in class names: <input class=validate[required,custom[onlyLetter],length[0,100]] name=firstname
We have a tab based application that needs to support the ability for a
Assume this model: Public Class Detail ... <DisplayName(Custom DisplayName)> <Required(ErrorMessage:=Custom ErrorMessage)> Public Property PercentChange
I have 6 required field validators and 1 custom validator. ErrorMsg is common for
Required is the true language version of the OS, not the user interface language
If so what are required configuration elements to enable UTF-8 for tiles? I'm finding
Since the only operations required for a container to be used in a stack
I am required to display a two dimensional numpy.array of int16 at 20fps or

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.