I wondering how I can make a UITabBat like this:
The height of this is more than the stand UITabBar and also the icons are larger. Also the arrow on top.
I tried changing the height but it looks really bad. The icons aren't centred vertically. Also I couldn't change the background.
Thanks.
I'd suggest several things;
Check out the core animation videos from this years wwdc, you can use it to create effects like the triangle and move it back and forth. Then write your own tab bar controller class.
you could also consider a third party library like http://cocoacontrols.com/platforms/ios/controls/tabbarkit
Related
I'm trying to make an UITabBarController like this:
No matter the device width (whether it is rotated or not) the buttons should not be stretched and the leftover space should be on the right side.
My questions:
Is this possible with the UITabBarController?
For the whitelines inbetween the buttons I am planning to use an unclickable UITabBarItem with an image. Is this the best way to do this?
With this tutorial that I followed I am getting this result:
2 problems here ^, whilst my background.png is 320x49, the selected image (68x49) has padding. This should not happen, both pictures have the same height?
The second problem is that the button/image has trailing space, and I want it sticked to the left side, as in my first screenshot. How would I accomplish this?
I don't expect anyone to post code, just merely a push in the right direction as I'm totally lost on this.
Check this library, you can customize the UI in interface builder with consstraints and get what you want.
I'm new to making apps for iOS and this problem has been bugging me for hours now.
The navigation bar in the modal popover view (on the right) doesn't properly extend to the top of the screen, like it does in other apps. I know that I could just disable Autolayout and do something like CGFloat newheight = self.InfoNavigationBar.frame.size.height + 20;
[self.InfoNavigationBar setFrame:CGRectMake(0, 0, 320, newheight)];, but I'd like to do this with Autolayout enabled, if at all possible.
Right now, the view looks like this when viewed on my iPhone:
How can I make it properly extend to the top of the screen, leaving the status bar on top of it? It'd be nice if this could be done in IB, without having to resort to doing all this in code.
(Edit: A few other iOS-related questions on SO suggest that IB and Storyboards are two different things. I don't even know which is which, take a look at the first screenshot, I'm using whatever that is.)
Apparently it's sufficient to override your UINavigationBar's positionForBar method like so: https://stackoverflow.com/a/18968920/1058399 It still feels like a dirty hack, but until there's a better way, I'll be doing that.
Edit in case any newbies like me read this:
All of this falls apart when you want your app to support landscape modes. Navigation bars are supposed to be smaller in landscape mode, which is done for you automatically if you wrap your view in a Navigation Controller. Don't just place navigation bars and expect them to "just work".
I'm working on an old code base written using Three20 (ack!). Now we need to be able to deploy this app to iOS7 and iOS6.
Mostly, it's working, but when the user taps and causes switching between view controllers, the navigation bar is drawn with a 44 point navigation bar during the transition animation, but when the animation finishes then it snaps to 64 points tall.
So, switch a view...smooth...butter...slam. Wash, rinse, repeat.
It's such a juddering effect when you switch from one view to another, on any iOS 7 iPhone-sized device. Interestingly, it only happens when switching from one view to another, not when switching to a new instance of the current ViewController.
I'd show code, but I'm not sure what code to show.
I'd appreciate any pointers at all (RTFM comments gladly accepted), my Google-fu has failed me this time.
View hierarchy looks something like this:
UIScreen
TTNavigatorWindow
UILayoutContainerView
UINavigationTransitionView
UIViewControllerWrapperView
UIView
TTTableView
UITableViewWrapperView
...and so on...
Is this a three20 problem where three20 assumed that Navigation Bars are always 44 points tall, but now they're not?
Is this an Interface Builder issue where the Navigation bars can only be created at 44 points, and I'm supposed to deal with this well in my code?
Is this an esoteric iOS 7 issue where it's decided that because the Navigator is at the top level, that it needs to change the height on a regular basis?
Is this a documentation issue where my (obviously meagre) powers of observation just didn't see the relevant bit in the Apple docs?
Thanks,
-Ken
First of all I would like to recommend to get rid of Three20. I know this is not very helpful for your situation, but really.
But then I would like to offer you two ideas on would could be happening:
Three20 indeed uses a hardcoded navigation bar size in various places, but I don't think this causes the problem you describe here. I may although pretty sure it causes Problem with iOS7 at other places.
From what you describe it sounds like the way iOS7 calculates the navigation bar height might be the problem. Of cause that would somehow inferrer with how three20 manages view, cause it works ok for plain UIKit. What happens if you move your whole view stack 1 px down, towards the bottom of the screen? I guess, that the navigation bar does not change it's size then. To understand that take a look at how iOS7 calculates the navigation bar height. I guess what you would like to have is the 64 px navigationbar throughout the whole animation. I'll have to figure out how to modify the frame of the view controller being presented before the animation to achieve that effect.
I hope some of this ideas can be helpful.
The question may be similar with
Designing inside a scrollview in xcode 4.2 with storyboards
but none of the answer there makes sense at all.
Okay I created a new controller and I added a scrollView.
The very first thing I noticed is there is NOWHERE to specify the content size of the scrollView.
Not in attributes inspector, not in size inspector.
Then what?
I am expecting some larger than normal box where I can draw all the view I want to put in. There is no such thing either.
I am very frustated.
All the "tutorial" out there tell about how to fill scrollView using code.
Another thing I tried is to select controller go to size inspector and then choose FREEFORM.
Great. I still can't make that template big.
Should I do this in XIB instead? At least on that one I can have one huge UIView. Or what is the official way industry standard way of doing this? Is there a WWDC for this one?
Say I want to draw something like these:
I don't think you can get a tutorial on this as it is simply impossible in IB. As most people already commented out what you want to do here need to be done programmatically.
If you are using XIB you can set up all your content there. Under the size tab (in the inspector) you will need to change the height to fill all your content but you still need to set up your contentSize programmatically.
For storyboard I don't think it is possible to change the size of your scrollview in IB.
I'm trying to make an animation effect similar to the one on Safari(iPhone) when you add an element to the reading list. It's similar to the one that appears when starting to download an item from App Store application: the application item drops to the dock to start downloading.
First it bounces up and then goes to the dock. It's a very nice effect that Apple uses on their OS.
I have an image view on screen that I want to drop with this kind of animation to my toolbar in my application.
If there is someone who did it or know what's the name of the effect, could please tell me how to do it.
Thank you.
"Add to reading list" shows no animation on my phone but of your description it sounds like the "Open in background"-animation in Safari (iPhone). My answer describes that animation.
I wrote a thing like that a few months ago and much of it is doable while some of it is not. Your questions showed me that more people are to know how it is done so I wrote a blog post about it. I will describe the high level approach and challenges here but you can read more about it in that post.
Getting to content to animate
If you choose to animate the view that is on screen down to the (in your case) tool bar then you will only have to access its layer. If you want the original view to remain and animate a visual copy (like the "open in background"-Safari animation) down to the bar item then you should create a new layer and draw the content of your layer into an image and set that image as the content of the layer that you are animating
Calculating the end position
The start position of the animation is simply the frame of the view. The end position is very tricky since bar items (both tool bar items and tab bar items) are not UIView subclasses and doesn't have a public view property. This causes problems when you want to shake the bar item later on.
I decided to make a visual approximation of the end position using some simple heuristics. If you know before hand that you will only animate to a single bar item then the end position can be hard coded to a suitable frame.
Animating along a path
There is nothing special to moving, scaling and rotating the layer from the start to the end position. If you want to read more about how I did it you can look at the post I wrote.
Shaking the bar item
This cannot be done without a lot of custom code or using private API at the moment. Since bar items doesn't have a view or a layer there is no accessible layer for you to animate. I guess that you could have a custom animating image that does the shake and set that during the animation and set the new image afterwards. The approach of drawing into an image and animating that doesn't work that well either since there is no accessible layer who can draw its content into the image (you want this for the special effect of the tool bar item and tab bar item).
...put all this together and tweak it to your special needs and you will have an animation that resembles the animation you are looking for.