How to change the height of a UIPickerView on ios 4.3? - height

Hi i would like to know if its at all possible to change the height of a UIPickerView on IPhone IOS 4.3.
Creating the UIPickerView programmatically doesn't work
Setting the frame size programmatically doesn't work
Modifying the source code of the xib file doesn't work (Does on ipad)
Cheers

Related

ZIPFoundation progress displayed using SwiftUI ProgressView

I'm having an application in SwiftUI and I am using ZIPFoundation to uncompress an archive. This works fine. At the moment I am using native SwiftUI ProgressView(title) to display during the uncompress process, again working fine, anyway it only displays a rotating wheel and no progress scale.
I would like to change to ProgressView(title, value, total) to display the scale, anyway not sure how. I have found this example, but it uses UIKit and addObserver() and I am not sure how to adapt this to SwiftUI, or if there is better way with SwiftUI.
Can anyone please help.

Cocos2d, How Set Device Orientation to portrait IOS

I had followed this http://www.cocos2d-x.org/wiki/Device_Orientation
but my RootViewController.mm not exactly look like that.
After i replace
'UIInterfaceOrientationMaskAllButUpsideDown'
to 'UIInterfaceOrientationMaskPortrait' there is some error on main.m
my cocos2d version = cocos2d-x-3.13.1 , on iPhone 7 simulator
You also need to go to xcode project setting and choose device orientation.
Here is a screenshot.

How to get app to be in landscape orientation in cocos2d 2.0

(Sorry I can't include the images. I don't have a high enough rep so i just provided links to the images)
As the title says, I am having problems with my app in landscape mode. I want the whole app to be in landscape mode so I selected only Landscape Left and Landscape Right in the Target Summary. I also put this:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
in my AppDelegate.m. I also went to my info.plist and put "Initial interface orientation to Landscape (left home button). However my orientation in the simulator and on the actual device are wrong. Here is a picture of what I have in my storyboard (what I want it to look like)
http://imageshack.us/photo/my-images/836/iphoneimage2.png/
But this is what it looks like in my simulator and on my device
http://imageshack.us/photo/my-images/440/iphoneimage.png/
Does anyone know how to fix this? Thanks
EDIT: If you are running Cocos2d 2.0 rc1 or rc0a, then the shouldAutorotateToInterfaceOrientation: method should be placed in the RootViewController.m file. If you are running Cocos2d 2.0, the the shouldAutorotateToInterfaceOrientation: should be placed in the AppDelegate.m file.
The method will already be in RootViewController.m if you used one of the templates in Cocos2d 2.0 rc1 or rc0a to create your app.
The method will already be in AppDelegate.m if you used Coco2d 2.0.
You just need to edit the method to only return the desired orientation you need.
Edit the method in your RootViewController.m or AppDelegate.m class, depending on which version of Cocos2d 2.0 you are using, to look like this to accommodate both landscape orientations:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}

Cocos2d-Things appear bigger in simulator

I've recently noticed that things accommodate differently on the simulator and a real device when using Cocos2d.To make sure I did the following:
1. I created a blank Cocos2d project. In the init method I created 7 sprites from Icon-72.png(which is found in the resources folder of the Cocos2d template) and added them to the screen.In the simulator only 6.5 sprites could accommodate side-by-side whereas in the iPod touch all seven sprites could accommodate easily and almost half of the screen width remained unused.
2.Then I created a project from Single View Application template. I added the same Icon-72.png to the project. Then on the storyboard I added 6 image views and set their image property to Icon-72.png. This time I had exactly the same result with both simulator and the device.
I guess there should be some tweak as to how to fix this issue with Cocos2d because it's not Apple's fault. Do you know how to handle this?
The iPod Touch could have the retina display and the simulator wont have have it. If you need the same display as of the iPod Touch You can use the iPhone Simulator with the Retina Display and you would get the same screen. Another Option you can use is Copy and paste the Same file with -hd prefix ex:(Icon-72-hd.png) with 72x72 size and you can get the same result.
There is no problem with either the version of cocos2d or with the Apple for the issue you are facing.
I guess I do have poor explanation but you would understand my explanation.
The iPod Touch will be a retina display. Cocos2d doesn't automatically double the size of images.

Cocoa application with cocos2d-iphone?

I'd like to do this:
Create a Cocoa application with a couple NSButtons in it. Also, a "cocos2d-iphone" view running in the same window.
If I trigger the NSButtons, a function is called in the cocos2d-iphone view (not sure where, maybe in the currently running scene?).
Well, I managed to create a new project from the cocos2d-iphone for Mac template, made the window bigger than the cocos2d view, moved the cocos2d view, and added my NSButtons. Now, I am not very sure about how to make the connection I need.. =/
I suggest reading an Interface Builder tutorial. This one is using Quartz, it's not Cocos2D but close enough. Simply assume the Quartz view to be Cocos2D view while you go through the tutorial.
Note that Cocos2D/EAGLView has some issues with NSView objects. In particular you can't add NSView objects as subviews to the Cocos2D OpenGL view, they will simply not be displayed. This is a general problem of the OpenGL view on Mac, and there are solutions/workarounds for this but they unfortunately do not work with Cocos2D. So if you're planning to have NSView objects overlapping the Cocos2D view … well, you can try and if you can make it work, PLEASE let me know how! :)