How can I lock orientation in OpenPlug (/flex)? - xcode

I'm writing program with Flex using OpenPlug. I'm having difficulties locking the devices orientation. From Project Properties I can find OpenPlug Studio Targeted Devices and their options. For iOS there is options to support (or not) different orientations and for Android / Symbian there is none.
Even if I select to support only "portrait" orientation with iOS, in emulator screen is not locked. I can't try it in real device, because I'm not able to generate XCode. There's another problem. I have selected to generate XCode, I've selected Apple - iPhone as device and I have selected target folder. When I click build-button, nothing happens..?
Any info regarding either one problem will be appreciated! :)

Not shure if this is still relevant - in OpenPlug Studio, you right-click on the project and choose "Properties". You then choose "OpenPlug Studio targeted Devices" on the left side in order to get the list of devices. You now click the button "Edit by Platform" on the upper right corner. This will render you a list of settings you can make. Among others, there are items "iPhone Support Landscape Left Orientation", "iPhone Support Landscape Portrait Orientation" and so on. Setting these should do the job of locking the orientation.

I have no idea what OpenPlug is, but it looks like an IDE, but I'm not sure. Frankly, it shouldn't matter. If you have a Flex project, you should have an application descriptor file (an xml under the source directory). Under that, there should be an 2 tags that you should be interested in:
<aspectRatio><!-- set portrait or landscape here --></aspectRatio>
<autoOrients>false</autoOrients>

Related

No option for Landscape in iPhone Launch Images

Is landscape splash screen supported in iPhone? I don't see the option like I do with iPad, as such:
That's Visual Studio?
Because I am able to see the iPhone Landscape option in Xamarin Studio.
Try switching on and off the "Assets Catalog" dropdown to see if that helps.
Also if that doesn't work you could change at anytime from Launch image to Launch screen and there you can configure your Storyboard for all different sizes and orientations.
Note: will check later in VS.
You could add them to your assets. I don't think image assets are rendered properly in VS. It doesn't show specialized image for iPhone, iPad, watch etc. Only the generic one.
Another thing you might want to consider is using launch story board and not launch images. That's the new way of doing it or the suggested way by Apple. You have far more control on it.
Customizing launch images - Manual approach
Open LaunchImage.launchimage and change the default launch images with your own using the proper resolution for each image (e.g., Default-568h#2x.png should be 640px x 1136px). If your images have different file names then open Contents.json and change the key filename for each image.
Xcode WYSIWYG approach
Drag and drop your Assets.xcassets into Xcode (7.1 or newer version). In the opened window choose LaunchImage and add the proper image for each iOS version and device. Close Xcode and rebuild your Xamarin app to use the new launch images.
Further info : Human guidelines reference

Xcode application, Splash screen doesnt work on low resolution iPad

I'm opening a topic here to find some help regarding the Splash screen on iOS. Apparently, all the process seems to be quite simple, but unfortunately, I've encountered a problem just on a specific case : the default splash screen is showed on the iPads with low resolutions (iPad , iPad 2, iPad Air , ...), the custom one is not set.
Specificity : The application is developed with React Native (Framework) only for iPad on a Landscape mode.
Here below you will find the steps that I followed to achieve the Splash screen :
2 pictures prepared for the Splash screen : Default-Landscape.png (1024*768px) & Default-Landscape#2x.png (2048*1536px).
Project opened on Xcode : MyProject.xcodeproj
Check out the folder "Images.xcassets" in the project.
Left click (2nd column from the left. In the full display interface) > App Icon & Launch Image > New iOS Launch Image.
Two new things appeared: one drop zone and a checklist with the devices that we wanted. Then I've chosen what interested me.
Drag and drop the images in the specific drop zone related to the good format.
After the image uploaded I've click on project "MyProject" (1st column) > click on target "MyProject" (2nd column) > click on "Use catalog assets" (button on the 3rd column) > select "Migrate" > then in the drop down menu I've chosen the settings that I've prepared before "LaunchImage".
Finally I removed the folder "Base.lproj" where the default splash screen (LaunchScreen.xid) was.
Result: After compiling, I've seen that the Splash screen was working for the high resolution devices (iPad Air 2 & iPad Pro), but unfortunatly, on low resolution (iPad 2, iPad Air, iPad Retina), I still have the default screen "NameOfProject" as headline and "Powered by React native" on the bottom of the page.
I really hope that you can help me on this one because I really don't know what's going wrong there. I've tried different import methods, differents sizes and names for the images. But still nothing work.
You may have to delete the app from the Home screen, and then reinstall it. iOS seems to cache the previous launch image for some reason.
Also make sure that your image sizes are correct if you haven't already.
Thanks a lot rclai89!!
Just to add some details to complete this topic. This video explains what you've advised me and solved my problem : https://www.youtube.com/watch?v=yiSehGHZZ18.
App removed from the Home screen : Once the emulator is running, on the top navigation choose Simulator > then Reset Content and settings.
Cache cleared : CMD + SHIFT + K
Derived Data cleared : On Xcode go to the Window item (top navigation) > select Projects > next to the "Derived Data" you have the path where the file is contained, just need to click on Delete button and everything is done.
Close & Re-Open Xcode. The next compilation for all the different devices (in my case iPad) show up the splash screen that I wanted. Awesome!

Is it possible to change the default Device shown in the Preview view in InterfaceBuilder?

As we all know, when you enter Preview in the assistant editor on a xib document, you are greeted with the "iPhone 4-inch" device. It is not possible to remove devices from the view once added. Has anyone researched a way to change the default device that appears? I can't imagine anyone designing with the 4-inch iPhone in mind. I really want to see 4.7-inch every time I use Preview. Further, suppose I was developing an iPad-only app.
You can delete a device by selecting it and click 'Delete' button from your keyboard (even first one created for 4 inch screen can be deleted). These changes are kept even after restarting Xcode.
Answer to your question is NO. There is no way to change this. A workaround would be to add the desired device, 4.7 inch in your case and delete default one. Next time when you'll preview your view you'll see the 4.7 inch device.

Swift - Problems with layout

I have a Universal application in Swift 2.0 developed in XCode 7.
On the storyboard simulated metrics, I have the 'size' set to 'iPhone 4.7-inch'.
When I run the application on my device (iPhone 5s), none of the labels are aligned and the toolbar is out of view. -This is also the case when I run using the iPad device in XCodes simulator.
Image of what the view controller contains ...
From the snippet above, when I run this VC on my iPhone there is no margin on the right side, and the toolbar is cropped off.
Can anyone advise how I can make a universal application show all the content in the VC, on all devices. Or how I would simply show the toolbar ...
That's what auto layout (constraints) is for.
On the storyboard simulated metrics, I have the 'size' set to 'iPhone 4.7-inch'.
That's irrelevant, and indeed misleading, since in means that only on the iPhone 4.7-inch will your app look like the storyboard design — unless you use auto layout.
iPhones come in many screen sizes. Basically, you have no way of knowing, as you design, what the screen size will actually be! Auto layout is the solution. Auto layout allows your interface elements to adjust automatically as the app launches on a particular size screen. iPads can serve as an extension of this — i.e., just an even larger size screen — or you can even use conditional constraints to make the interface quite different on the iPad from the iPhone, if desired - all designed in a single storyboard.
Maybe you are using auto layout and auto constraint. You could deactivate this in opening the storyboard, open up right panel , go to "show the file inspector" section and under Interface Builder Document uncheck auto layout and auto constraint
Image here
Select your item view, go into "Show the size inspector" and there you can set your autoresizing for all devices

How do I anchor controls to one side in Xcode?

Ok, so I come from programming in Visual Basic on PCs, and now I'm trying to remake my programs on OS X with Xcode, and so far I have been successful. One thing I have noticed, however, is that when I try to resize the window, controls either stay in the same place or stick to one side. In Visual Basic, I used the "anchor" or "dock" properties to decide whether controls would stretch as the window resized or if the stayed to one side. I was just wondering if there is an easy way to do this in Interface Builder. I am using Xcode 4.5.1 and any help I could get would be great.
Thanks in advance!
In IB, click on the file inspector (The first icon), then make sure auto layout is not checked. Then go to the size inspector (The 5th icon) and make your changes.
(source: fredandrandall.com)

Resources