I have put a view in view controller and gives frame to it. when ever I run the application in xcode 5.1.1 it works fine. But in xcode 6.0 it shows correct frame in storyboard. But at runtime frame changed to (0, 0, 0, 0). I have not change the frame runtime but it change automatically. So Please help me to sort out this issue.
Thanks in advance.
Related
I have an application derived from the Xcode Cocoa Application template that prints properly on El Capitan, but introduces a centimetre margin all round with a shadow box on Sierra. Changing the margin values (in the shared instance in viewDidLoad of the viewController) to larger positive values makes the margins bigger, but reducing them to zero still leaves the margin and shadow box. The image is a screen-shot of the print preview. I would like to go back to having the PDF take up the whole printed page. Looking at the menu for the File/Print shows it executes firstResponder print:. Should I try to override this function? But if the code below is being executed to no effect, what good will this do?
NSPrintInfo *PageDefaults = [NSPrintInfo sharedPrintInfo];
[PageDefaults setBottomMargin:0];
[PageDefaults setLeftMargin:0];
[PageDefaults setRightMargin:0];
[PageDefaults setTopMargin:1];
If I increase the top and left margins in the code above to 120, the print changes to:
The storyboard shows that I am only using a PDF View control that fills the entire viewController scene
And finally, the viewController on screen shows it looks as it should:
-[PDFView print:] in 10.10 calls printWithInfo:autoRotate:pageScaling:. In 10.12 -[PDFView print:] calls printOperationWithView: and prints the background. Solution: create a subclass of PDFView, override print: and call printWithInfo:autoRotate:pageScaling:.
- (void)print:(id)sender {
[self printWithInfo:[NSPrintInfo sharedPrintInfo] autoRotate:YES pageScaling:kPDFPrintPageScaleToFit];
}
iOS 8.0.2 and iPhone plus when I set UIButton backgroundImage in XIB,UIButton become bigger though this button have layout with height and weight after running
UIButton in xcode:
and layout :
but running in iPhone plus iOS8.0.2:
but in other iPhone like 5s,6 this button is ok!!!
the backgroundimage like this :
i have setup (https://github.com/usamaiqbal83/TestingProject) a repo for your case, it is not happening for me you can compare your setup with mine . i checked it on simulator
or if i am not able to understand your scenario clearly, kindly setup a repo i will gladly take a look.
when I set the Image like this:
it is working .
I do not what has happen, but just it is.
any body know why it is?
My application has a log window that displays lines in an NSTableView:
When I add auto layout constraints to the window no matter what I do I get a Misplaced View warning for the Clip View:
I've tried updating its frame, updating its constraints, and resetting to suggested constraints, but nothing gets rid of the warning. The window displays and resizes correctly at runtime, and it doesn't even appear to be possible to add constraints to the Clip View itself.
I've pushed the code to github if you want to look at it in Xcode: https://github.com/MagerValp/AutoDMG/tree/e57b0140e3fc3f7f9e0d4550341ed249a6cf5378. The code requires the 10.10 SDK to compile, but the xib should be viewable in Xcode 5 and up.
I met the same issue recently, warning about Clip view expected value is 17px larger than actual value.
I believe it is a bug of Xcode. And I do find a workaround to fix it(other than downgrading my OS to 10.9).
The solution is to edit the attributes of tableView in IB, disable "Headers". Don't show table headers and the warning will be magically gone. And we can guess that by default the table header is 17px :)
It's just a workaround, not an ideal solution. This is not our fault. The best solution is to wait for Apple to fix this Xcode bug.
Scrollviews' subview hierarchy are only sort of compatible with auto layout.
One way around this is to constrain the clip view so it is not bothering you.
Then in the inspector, mark those constraints to be removed at runtime.
ScrollCiew
ClipCiew
TableView
If the error is coming from ClipView.
Check the ScrollView size, remember it.
And then click ScrollView as target, open up size inspector, enable Intrinsic Size using Placeholder with ScrollView size.
I use the Xcode 12.3, the latest version of Xcode. But also have the same warning. I remove the misplaced view warning by change the TableView Content Mode from View Based to Cell Based and then the warning disappeared. And then I change back to View Based. The warning will never appeared again.
I have an UISegmentedControl with 100x42 bounds. I've set up three segments with 26x26 images and 4x42 divider images. The three segment images should fit in the segments, but they are scaled and for the worse they seem to fit vertically and are only scaled down horizontally, thus loosing proportions.
This problem appeared after i changed to Xcode 5 and iOS 7 SDK. Before that the segment images were displayed with correct proportions and in original size.
I'm not using interface builder. I've tried to set the segment sizes manually and setting the segmented control's contentMode to UIViewContentModeScaleAspectFill without help.
Is there any way to force the UISegmentedControl to simply render the images as they are?
You may set auto layout constraints to correctly define UISegmentedControl frame. Like this
I know this is a late answer but I have the same issue testing an app for IOS 7.1.
If you set the image in the code it's working properly. Example:
- (void)viewDidLoad {
[super viewDidLoad];
[_segmentedControl setImage:[UIImage imageNamed:#"779-users-toolbar"] forSegmentAtIndex:0];
}
In my project I have the normal image, and the #2x & #3x versions of the image.
I tested the code in 7.1, xcode 6.1.
When I run it in 8.1 the image set via IB works properly as well, so this may be a bug in 7.1 that has been fixed in 8.
Has anyone ever had the problem that a UIScrollView, which gets moved by [UIScrollView setContentOffset:...] doesn't "remember" it's new position? It however does, if the user scrolls via touch-and-drag.
Symptoms: If the UIScrollView doesn't remember the new position, it "flips" back to the original position it last remembers (which is the position which has been used via touch-and-drag) whenever it's being touched.
Interesting:
This only happens in 4.0 and
didn't happen in 3.1
This only happens if pagingEnabled == YES is
set
It turned out that the contentInsets would confuse the contentOffsets in iOS 4.0 ... must be a bug in the SDK?