Small space at the bottom of the device in ios7 - ios7

We are developing an application working on both ios6 and ios7
My problem is that, If I check my application in device there is a small white space equal to the size of the status bar at the bottom of the screen.
If I put a dummy status bar at the top of the screen it will make problem in ios6, Help me if you have any solution.

That is the common status bar issue while migrating application from IOS 6 to IOS 7 use this to get ride of the issue:
For more reference
https://stackoverflow.com/a/19025547/1545180
You need to set the delta value for all the controls followed by increasing the origin x to 20pix for all the controls.
Step 1: Increase origin y to 20 pixel (for all the controls in the .xib)
step 2 . And set delta y to - 20 for all the controls in Xib.
Step 3 . Finally change the view as version in interface builder.
If your adding the controls programmatically you need to handle the frames (increase the y position based on the version ) of the added controls like this
if([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0f)
{
[_programmaticallyAddedControl setFrame:CGRectMake(20, 36, 176, 428)];
}
else
{
[_programmaticallyAddedControl setFrame:CGRectMake:CGRectMake(20, 56, 176, 428)];
}

Related

autoenablesDefaultLighting is too bright in iOS 12 and SCNView.pointOfView is not effective

I am using SceneKit’s autoenablesDefaultLighting and allowsCameraControl functions of my sceneView to provide light to an obj 3D model in the app and rotate around this object in Objective-C. Since upgrading to iOS12, the default light intensity of autoenablesDefaultLighting gets higher and the 3D model looks so bright!
Did anyone faced the same issue? If yes, is there a way to control the light intensity of autoenablesDefaultLighting when its value is ‘YES’? If it is not editable, I tried to attach/constraint an omni light or directional light to a camera by creating a node, assign a light to this node and add as child of SCNView.pointOfView but no light illuminates the scene.
Exemple:
3D object displayed before iOS 12
3D object displayed in iOS 12
It will be good if anyone can help me on it.
Many thanks!
Edit to solve this issue
I create a new SCNCamera and add this in a node and set the PointOfView of my scnView.
Activate the HDR of this camera with scnView.pointOfView.wantHDR = YES;
but a had a grey background.
To delete the grey background I delete the background color with scnView.backgroundColor = [UIColor ClearColor]
and set the explosure of the camera to -1 with :
self.scnView.pointOfView.camera.minimumExposure = -1;
self.scnView.pointOfView.camera.maximumExposure = -1;
Thanks
You can try enabling HDR. It should result in a balanced exposure
scnView?.pointOfView?.camera?.wantsHDR = true
With HDR enabled, you can even control exposure compensation with
scnView?.pointOfView?.camera?.exposureOffset
.camera?.wantsHDR = true
.camera?.wantsExposureAdaptation = false
Should solve the problem!

Python platypus changing from Portrait to Landscape

I'm looking for some inspiration. I have some code that is changing the orientation of a page from the default portrait to landscape however the frames I create within the pagetemplates always get created as if they are on a portrait page still.
doc = BaseDocTemplate('test2.pdf', pagesize=landscape(A4))
myFrameThresholdLeft = Frame(
doc.leftMargin,
doc.bottomMargin,
doc.width / 2,
doc.height,
showBoundary=1 # set to 1 for debugging
)
emptyTemplate = PageTemplate(id='emptyTemplate',
pagesize=landscape(A4),
frames=[myFrameThresholdLeft,
myFrameThresholdRight],
onPage=emptyLayout)
elements.append(NextPageTemplate('emptyTemplate'))
elements.append(PageBreak())
I think this is because the values returned by the e.g. doc.width methods are not changing as I change the pagesize in the pagetemplate. Can someone put me on the right tracks here?

Programmatically Add Subviews to UIScrollView and Keep Constraints

I am very perplex as to how Auto Layout and Constrains are handled in iOS 7.
I have a UIView that has an embedded UIScrollView... inside that UIScrollView I have a Container View. Inside this Container View I have 3 Views...
Label
Content Area 1 (10 pt under Label)
Content Area 2 (10 pt under Content Area 2)
Note: these constraints will always the same.
The label will always have the same dimensions.
When the View is first shown on the Screen both Content Area 1 and Content Area 2 are 30 pt in height with an ActivityViewSpinner spinning while 2 separate Ajax calls are made to load the data for these sections.
The data for Content Area 1 will be one of two things... either a 320x320 image or a button asking the user to submit an image.
The data for Content Area 2 will be one of two things... either a label saying there's no data or a UITableView that will be 320x300 full of data).
The use case I'm testing right now is just making the Ajax call for Content Area 1 with an image coming back... I get my Image, however, it doesn't respect the 10pt "top of content area 2 to bottom of content area 1" constraint.
I have implemented updateViewConstraints with the following code
[super updateViewConstraints];
[_containerView addConstraint:[NSLayoutConstraint constraintWithItem:otherSubmissionsView
attribute:NSLayoutAttributeTop
relatedBy:NSLayoutRelationEqual
toItem:mySubmissionView
attribute:NSLayoutAttributeBottom
multiplier:1.0
constant:10.0]];
However, here is what the UI looks like:
I am very perplex as to how to go about keeping this constraint in tact.
Any help would be AWESOME.

Less mixin to distinguish desktop / normal tablet / retina tablet

I am trying to use separate media queries for Desktop / Normal tablets / Retina based tablets.
I have one set of visual design & icons for desktop, another set for tablets.
What is the best possible way to write a less mixin so that i can give one set of icons to desktop, another set to normal tablets and the 2X ones to retina based ones?
Right now, i am trying using the following snippet, but this one cant handle the normal tablet query. The less than, greater than symbol cant be used in media queries, else it would have been easy to write one mixin for device-pixel-ratio: 2 and another for device-pixel-ratio < 2 .
I tried with min-device-pixel-ratio:1 , but then, that gets applied to the desktop as well.
I need a query which can uniquely identify the normal tablets excluding the retina ones & desktop.
Is it correct to write like this for normal tablets? Putting a breakpoint just under 2 so that 2 and above will take the retina based query and 1.9 and below takes the normal tablet. But then, this query is applicable to desktops as well?
#media
only screen and (-webkit-max-device-pixel-ratio: 1.9),
only screen and ( max--moz-device-pixel-ratio: 1.9),
only screen and ( -o-max-device-pixel-ratio: 1.9),
only screen and ( max-device-pixel-ratio: 1.9),
{
Query that i have now.
.retina-image(#file-1x, #file-2x, #width-1x, #height-1x) {
background-image:~"url('#{imgPath}/#{file-1x}')";
width:#width-1x;
height: #height-1x;
#media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and ( min--moz-device-pixel-ratio: 2),
only screen and ( -o-min-device-pixel-ratio: 2/1),
only screen and ( min-device-pixel-ratio: 2),
only screen and ( min-resolution: 192dpi),
only screen and ( min-resolution: 2dppx)
{
background-image:~"url('#{imgPath}/#{file-2x}')";
background-size: #width-1x, #height-1x;
}
}
Any pointers will be of great help!
TIA

Widget integrated going out of its own zone

I got a main window (Item) with a 640*480 size.
I integrated a custom widget defined in another qml file, its size is 100*100. This item contains a Pathview that only shows 3 items from a list containing a lot of items.
The thing is that when I add my CustomPathView to my main window at coords (0, 0), the PathView goes to the bottom of my main window, displaying 7/8 items... (?!?)
My CustomPathView.qml file starts with :
Item {
width: 100
height: 100
That's why I really don't understand why it is displaying 8 items...
Did I do something wrong ? Do I have to precise to my CustomPathView that he can't go out of its zone (how ?) ?
Thanks in advance for any help about it !
Just set the clip property to true.