UIPageViewController custom PageControl - ios

For a project I am working on I would like to modify the looks of the UIPageControl I found out that I could change some things with the appearance method on UIPageControl.
However I would like to change the dot size and spacing. Looking on the internet I came across FXPageControl. Which supports this.
Currently I am loading my UIPageViewController from StoryBoard. And it thus loads a "normal" UIPageControl. How can I make the FXPageControl be loaded instead?

You can't.
You can only don't show default UIPageControl and show & handle FXPageControl manually by yourself in code / xib

Related

iOS Equivalent for Android TabLayout

I am developing an app which involves paging(Horizontal Scroll). Which i achieved through UIPageViewController.
Whereas i need help and suggestions to achieve the design i have attached below in the image -> The pager in the bottom with the Title, Filled circle and the Line. The pager scrolls along with the page and the respective circle is filled/selected.
In android they use a customised version of TabLayout. I want to figure out the equivalent in iOS
You can use UITabBarController
You can use UIPageViewController and also UIPageControl, for the circle animation coupled with the changing of the pages or View Controllers.
Here is a tutorial on how to implement it.

iOS add view to Button in IB

I am trying to add a view on a UIButton inside IB. The only problem it doesn't allow me to put in inside the button only on top?
Is this not possible through IB or am I doing it wrong?
It's not possible in Interface Builder. You have to add it in code.
You should not do this:
Do Not Customize Controls by Embedding Subviews
Although it is technically possible to add subviews to the standard system controls—objects that inherit from UIControl—you should never customize them in this way. Controls that support customizations do so through explicit and well-documented interfaces in the control class itself. For example, the UIButton class contains methods for setting the title and background images for the button. Using the defined customization points means that your code will always work correctly. Circumventing these methods, by embedding a custom image view or label inside the button, might cause your application to behave incorrectly now or at some point in the future if the button’s implementation changes.
https://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/WindowsandViews/WindowsandViews.html#//apple_ref/doc/uid/TP40009503-CH2-SW26
If you need to add a UIView on your UIButton you can achieve it in 2 different ways
The easy way is to follow Cyrille answer: you can do it programmatically because IB doesn't allow you to modify a UIBUtton adding a view on it
The hard way is to create your custom button (let me call it "MYCustomButton"), that extends a UIButton, and use it in your application. With this way when you need to modify the buttons in your interface, you can achieve it modifying the XIB of the "MYCustomButton".

Xcode custom control via storyboard

I want to use a custom control in my project, specifically a horizontal picker view I found on cocoacontrols.com (http://cocoacontrols.com/platforms/ios/controls/cppickerview). I've been able to include it into my project, load data and it works very nicely.
The pickerView is setted up programatically on viewDidLoad but I'd really like to be able to use it via storyboards because I'm a using static tableView. I tried to add a UIView, set the class to the PickerView class and then set up the outlet. I builds without errors or warnings but the picker view does not appear. It only shows a white rectangle.
Anyone with experience in this? Is it possible at all or should I keep it programatically?
Thanks in advance!
Well, that's normal. CPPickerView does not seem to implement initWithCoder:... I only see an initWithFrame: in the source code, which obviously means you can only instantiate that custom UIView from code. Or you can change CPPickerView's implementation to support what you want. It's open source.

After rotation strange behaviour with UIScrollView

I have an iPad application and in one of my views i use UIScrollView and UIPageControl together to navigate between views array. when my simulator is on Portrait mode there is no problem but when i rotate it to Landscape just down side of the scrollview appears and i can see just about 30 per 100 of the whole view. How can i fix this situation can anyone help?
EDIT : I dynamically add some buttons-subviews on the subview that i have added to Scrollview, can some one give any idea about how to detect the orientation of the device and decide the frames. I need something like the pseudo below:
if(device_orientation == landscape){
subButton.frame=....;
textfield.frame=...;
}
else{
subButton.frame=....;
textfield.frame=...;}
}
i tried but i got black screen..
EDIT-2
I used Interface builder for some views and there are some dynamically created views.I played a little with Autoresizing properties on the .xib file and now it looks perfect but the dynamic ones(they are all objects of a subclass of UIButton) dont response to any code(resizing, bacground color-photo ect..)
Are you using interface builder or creating your view programmatically?
It would be helpful if you could post some more of your source or some screenshots so that we can see a bit more clearly what's going on. As a stab in the dark, you might want to try setting the 'autoresizingMask' property of the views which you want to resize to '~UIViewAutoresizingNone' (not-none/flexible). If you can provide some more details, I'll try to help you some more :)

Using UIScrollview to display .xib as different pages?

I think im missing something fundamental here because everyone seems to be able to do this simple task. Im trying to create an app that is very similar in presentation to the iPhone home screen (paging). I plan to have several pages that each have their own unique content. My understanding is that I can use UIScrollview to display and animate these pages/xib's but I have tried what seems like everything and am frustrated by the lack of instructions for newbs like me.
What I understand so far:
Declare IBOutlet UIScrollView *scroller
Set options in .m or in scrollview object via IB
connect fileowner of main .xib to *scroller
connect fileowner of main .xib to delegate
then somehow call in the other xib to load as the pages for the scrollview.
One thing i have found is that most of the tutorials and source codes i get are outdated or look different. Im using xcode 4.2. ANY HELP is greatly appreciated. Thanks!
I'm also a newbie so may be I don't understand your problem exactly but if you want to represent your scroll view in pages you should enable paging for it:
yourCoolScrollView.pagingEnabled = YES;

Resources