Create UITabbarController with xib for 5.0, which worked fine.
But when app is installed in 4-inch device, tabbar item is misplaced. Attached screenshot.
How this can be fixed. Am using UITabbarController in xib
Thanks in advance,
I faced the same issue with UIBarButton, it only happens with System icons in my case, using custom icons worked fine.
I couldn't find a proper solution, but subclassing the object and changing the frame position of the image after the fact seems to work.
I'll update this if I find a solution that works consistently.
related post:
iOS UIBarButtonItem allignments
Related
I've read that the way to animate a launch screen in iOS13 and Swift 5 is to create a LaunchScreen.storyboard and Main.storyboard that are identical, and then animate the Main.storyboard elements when the view has loaded.
I have created a LaunchScreen.storyboard and Main.storyboard that I believe are identical - each consist of one image aligned to the centered of the superview. When I run the app, I can visibly see the difference when the storyboards transition from one to the other. Is there something I might be doing wrong here to create identical storyboards?
I have included screenshots of the storyboards that show the constraints I've applied to each respective UIImage on each storyboard. Is this the right approach to achieve an animation of the Launch Screen? Are there some inherit differences about the types of storyboards I'm working with here that I might be overlooking? Any help would be greatly appreciated.
I solved my issue - I don't have a satisfying answer with a lot of closure, but essentially I just uninstalled the app from my simulator and rebuilt it and the issue was gone. Some previous version was being cached and hadn't been overwritten with the changes I introduced. Thank you for the folks to reached out to assist me.
I added one image set and set its Render As -> Template Image.
Added one button to storyboard and changed its tint color. It works perfectly when I check in the simulator.
Issue - 1) But color don't get updated in the storyboard.
I have added one image view and changed its tint color from the storyboard.
Issue - 2) But color don't get updated in the storyboard nor the color change appears in the simulator.
I have added one image view programmatically and set its image and tint color that works perfectly in the simulator.
What might be the above issues any idea?
Issue 1) That seems issue with Xcode, next releases may come up with fix.
Issue 2) That seems issue with Xcode too.. When I faced that situation I had to add ImageView programmatically which worked. You may also try IBDesignable or Custom class or Extension which changes renderMode property.
Was it suppose to reflect Template Image color on StoryBoard by changing Tint ?
I checked on Xcode 8.2.1, Xcode 8.1, Xcode 8.0 and Xcode 7.3.1
None of them reflected the color on StoryBoard. Its works fine on Simulator and iPhone though.
I don't think this functionality was ever there. Correct me if I'm wrong.
Issue - 1) But color don't get updated in the storyboard.
have look this one :
ios 7.1 UITextField tint color doesn't change in storyboard
Issue - 2) But color don't get updated in the storyboard nor the color change appears in the simulator.
this issue arise for the template rendering mode with a UIImageView in a storyboard or xib, on iOS 7 , iOS 8 , iOS9 and iOS10 cause it is still buggy.
more information check this thread Modify UIImage renderingMode from storyboard/xib file
I think so programmatically is good solution.
The only way I've been able to get it to work is by creating an outlet of the UIImageView and calling this in viewDidLoad (or in VC):
imageView.tintColorDidChange()
This has been a bug since iOS 7 or 8 I believe.
I think this issue is resolved in Xcode 11.
I tested on iOS 13, 12 and 11 and it works fine now in storyboard, simulator and device 😀
So I replaced my code by setting image in XCAsset as Template and changing tintColor of UIImageView and UIButton in storyboards and Xibs.
Simply, from Xcode, go to assets > then select your image > then from Inspectors menu (on the right): change the value of Render as to Template image
Then go to your storyboard > then change Tint color as you wish, and voila!
Try
Clear the derived data
Clean Project
or
Use custom button
Please take iboutlet of that imageview and change the tint color programmatically.
Try refreshing all views, maybe it helps:
=== EDIT ========
This issue is now solved in Xcode 8.1. I have checked.
================
I don't know auto-layout properly. So, I am using autoresizing option in my all apps and it's fine for me. I am able to fulfill my all requirements by this without any issue.
Now in Xcode 8, I have migrated my old swift project to swift 3. Now issue arises.
See in image, I have set Autoresizing, and its working fine without issue in all devices until now and this project is live in AppStore, so that I can't show the UI or storyboard.
Now I have to do some update in project. So I am working in Xcode 8 now. But my autoresizing not working properly, as all the controls are come in center and UI is messed up.
And the issue persists in device also. I have checked in simulator and device as well. But problem is there also. Any suggestion and help will be appreciated. Thanks in advance.
EDIT:
Yesterday there is issue in runtime only, But Today storyboard also changed views like this image
Which means the whole UI design is messed up. This is weird.
Facing same issue. As a my point of view this problem is occurred when we use autoresizing and set only inner autoresizingMask to any view controller. Like,
If we use also boundary autoresizingMask at that time not facing this issue. Like,
I don't know this is actual bug of xcode 8 or remove this functionality in xcode 8.
So, Finally my suggestion is that we need to use auto layout in xcode 8.
Please try to uncheck autoresizing from xib or storyboard. And inviewDidLoad set [_scrollView setAutoresizesSubviews:YES];
Try it if this solve your problem
Edit: In case of storyboard uncheck Resize view from NIB option.
I'm not sure about storyboards but I've found a temporary solution for xib files. In Utilities panel (right hand panel) select File Inspector tab. Under Interface Builder Document section, select the file to open in "XCode 7.x". It will ask you to confirm that you do not want to use XCode 8 features, save the file and close it.
Xcode 8 beta 2 solved this problem!! I already checkeded now!
I had a similar issue for scrollView in Xcode8
I have an one solution to work with scrollView
First take a simple UIView and add all component which you want add to in scrollView and give that component to autoSizing
And also take one scrollView and programmatically set view frame and also set scrollView contentSize and add your view into scrollView
like wise, in my case I added this code in viewDidLoad for swift project
// add view to scrollview
self.scrollObjForNextAppointment.contentSize = CGSize(width:self.scrollObjForNextAppointment.frame.size.width,height:410)
self.viewForScrollContent.frame = CGRect(x:0,y:0,width:self.scrollObjForNextAppointment.frame.size.width,height:410)
self.scrollObjForNextAppointment.addSubview(self.viewForScrollContent)
it's work for me, Thanks!
Solved by unchecking "Auto Resize Subviews" to ScrollView
Update the issue seems to have been fixed in Xcode 8.1
Having the same issue and I've found that the offender here is the UIScrollView element. Just move everything outside of your scroller and you will see that everything works just fine, like before.
Which means one possible workaround would be to place your scrollable content in an ordinary UIView, then replacing it with UIScrollView at run time, programmatically.
A moderator kindly deleted my answer here as a duplicate, so see my answer at:
Autoresizing under iOS 10 doesn't work
In response to max, yes, resizing a bunch of subviews can be a pain. That's why I suggested adding a single "content view" to the scroll view and moving all of your existing subviews inside of that view. Autosize the subviews inside of the content view just as you did with the scrollview, and autosize the content view to the scrollview.
It's that content view that you're then resizing inside viewDidLayoutSubviews.
And again, the "content view" inside of the scrollview construct is pretty much the standard way to get auto-sizing scroll views using autolayout, so it should be considered a best practice.
That method is described here...
https://spin.atomicobject.com/2014/03/05/uiscrollview-autolayout-ios/
My method seems a little convoluted, but I was able to patch up a storyboard with about a dozen scenes and Vc's in about 15 minutes. It would have taken much, much, much longer to rebuild everything using auto layout.
Apple just came out with XCode 8.2, which fixes this problem for me. I have been using XCode 7.3.1 for my interface design parallel to 8.1, but I can now use 8.2 without any problems.
The storyboard gets updated with widths and height of frames though, to accommodate the new 'View as:' functionality. Though it doesn't seem to affect running on device/simulator.
Curiously, the bugfix it is not noted in the XCode 8.2 release notes.
Original answer here
I created a project (i believe before i update to Xcode 6). Now when i look at storyboard none of my Obects/Outlets (UITextfields/UILabels/UIButtons) are visible, they are still there and appear when i run in simulator.
Has anyone come across this and have any ideas?
Thanks in advance
may be you need to need to re-size the view controller because its default have a universal view so you have to set the size to view-controller for only Iphone.
hope it will work
I am facing one serious issue in my app regarding UIImageview. It's not displaying images if i set from using UIImageView in xib but if i set it through code then it's getting displayed. And this issue is coming in Xcode 5.1.1 or above version of Xcode and in device. In simulator it's displaying all images perfectly.
Please help me solving this issue.
Any help will be appreciated.
Thanks.
hope this will help
if your image is shown in simulator(in all the condition through .xib or programmatically) and not in device , it might due to of case-sensitiveness
iPhone OS uses a case-sensitive file system, unlike the Simulator which uses a case-insensitive file system by default
for info:https://developer.apple.com/library/ios/qa/qa1697/_index.html
I also experienced the same problem and what I did is just deleted the UIImageview and reconfigured it and it worked. I think this is the problem with XCode new versions.
It's a problem/bug with Auto Layout constraints in iOS 7. If you remove the constraints on the UIView, it works no problem. You can set frames programmatically if you need to.
try this,
[youImageView setOpacity:1];
Actually "opacity" means "value of alpha-channel" of your UIView. When a view is fully opaque this means its alpha = 1, when a view is fully transparent (non-opaque) its alpha = 0.
As about properties of CALayer and UIView in Cocoa, they provide the same functionality.