Is there a way to customize the bottom tabview buttons to have different sizes and even shape. Something like this:
Thanks!
If you want the UITabBar to have a different shape or size, unfortunately, you won't be able to change it even by subclassing UITabBar.
To get started, you'll want to take a look at subclassing another type of UIView -- either vanilla UIView or UIImageView, add icons to them, and configure touch events to make them do what you want.
Here's some helpful resources for you to get started:
How Can I Create My Own UITabBar?
Making a Thinner UITabBar
Related
I use standard UINavigationController with custom provided UINavigationBar. I cannot find a way how to expand the height of the bar, yellow area on the screenshot. Need to put a UIView on extra space.
Looks like a simple task, but after trying everything I'm out of ideas :(
Should support iOS 11+.
Final Design
I'm trying to make this, three paging views in one with a custom nav bar with icons that will scale when its view is brought up. What is the best way to make the three views, like snapchat's, and how can I relate them to the icons in the nav bar to them? I know that I'll use collection view inside those views with supplementary cells.
I tried to make a Collection View with 3 cells moving horizontally to make the views but I cant relate the icons in the nav bar.
By the way, is it possible to make the navbar triangular like in the GIF?
This is a very broad question but will try to give you pointers for each of the features you are requesting.
To handle the paging views similar to snapchat with relative icons check out SLPagingView. This is a great place for you to get started. You'll need to add in some more code for the scaling but should be trivial.
In order to create a navigation bar similar to what you want you'll need to subclass UINavigationBar and override sizeThatFits and set a backgroundImage. See here here and here.
I am creating a UINavigationBar that will expand and contract in various states. The top image is when it is in a contracted state with a transparent background. The lower image represents when it has expanded with a background and search bar. As the user scrolls down the nav bar background would animate in and expose the search field.
Can someone suggest the best way to build this?
So far I've explored subclassing the UINavigationBar, but I've been having a really tough time with the placement of the items within the nav bar or hooking that view up to a xib. I've also see examples where the extended content is just a UIview anchored to the top of the view controller top margin, but then I'm splitting the appearance of my nav into two views which will make the animation problematic.
According to the answer to UISegmentedControl below UINavigationbar in iOS 7 it can be accomplished using a UIToolBar and some delegate methods.
You might have to tweak it a little bit however, to fit the search bar that you want to include.
I wish to create a view similar in behavior to the UINavigationBar.
I cannot simply customize the bar as I want the space to be taller and I want to have several other subviews on it other than just UIBarButtonItems. So, I want to be able to create a similar implementation including the floating/translucency effect.
I good example of this is the address bar in Safari in iOS 7. The UITextField on the bar is something that cannot be added on the default UINavigationBar. Nevertheless, the Safari bar still has the transparency.
I do not want it to shrink like it does in Safari when scrolling down, I simply want it to remain just like a UINavigationBar would. I was thinking about adding a subview to the root UIScrollView, but this would scroll along with everything. I want this to remain at the top, but I want other elements to be able to scroll.
How would I go about implementing this?
If you are confident that you can't to this with the default UINavigationBar, you could shrink (from the top) the UIScrollView with whatever the size the custom UINavigationBar is and then add the navbar as a subview to the root view at (0,0) coordinates. It will be independent from the scroll view.
On the other hand, if you need this to be persistent through the application and use it in all of the screens, it will be wise to make some changes starting for the AppDelegate, but that's for another question.
For the iOS 7 transparent-style part, look here: FXBlurView. Best of luck!
I have a custom view which I would like to look like a UINavigationBar. Is there a way for me to draw the background the same way a UINavigationBar would?
I don't want to draw an image or a gradient fill that looks like a UINavigationBar - I want to use the same library code (if it is public) that a UINavigationBar does to draw its background.
The drawRect: method of a UINavigationBar is private - you can't use it to draw the background of your own view.
The easiest way round this would be to take a screen shot, trim the image to nav bar size, add to your project, and then either draw the image in your view's drawRect: method, or add a UIImageView as a subview of your view.
Alternatively, would it be possible to use a UIToolbar instead of your custom view?
You could set your view background image and just use an image that has the navigation bar look already filled in.
As far as tapping into whatever the navBar uses to create itself, you are probably out of luck unless you just build a navBar into your app. Otherwise you would end up having to build a custom view at the top of your app, draw everything in manually. At that point, you are probably better off implementing the navBar.