I need to present an OpenGL "panel" on the same screen as some controls, web/text content, etc. Any suggestions? Ideally I'd have an OpenGL control that could be dropped onto a form in Interface Builder and manipulated in the same way that buttons, etc. can.
I suppose a good OpenGL UI toolbox that provided standard controls like buttons, gesture control, etc. would also work.
The best analogy I can think of at the moment would be presenting 3D content on the top 1/3rd of the iPad screen, and related text and text-related navigation controls on the bottom, like they've done with some of the textbooks in the Apple TV commercials.
I found this similar question, but am not really clear on the the meaning of the answer. (This is my first non-"Hello World" iOS app, so some of the terminology is unfamiliar.)
You should be able to use iPhoneOSGameView to render any 3D content with OpenGL.
Here is an example of using it: https://github.com/xamarin/monotouch-samples/blob/master/GLPaint-GameView/PaintingView.cs
I would think you should be able to place one of these view in a UISplitViewController on iPad, or just on 1/3 of the screen. This is that split screen control you see in the mail app, for example.
Also, to use a class from Interface Builder all you need is:
[Register("MyClass")]
class MyClass { public MyClass(IntPtr handle) : base(handle) { } }
So you have to register it, and include the IntPtr constructor.
Good luck, I haven't found an example of exactly what you're trying to do.
Related
In a charting UIView, I would like the user to be able to start with the whole dataset and then use a trimming control similar to that used when trimming video in the Photos app:
That is, two handles that can be dragged in and out, translucent panes on either side to indicate "out of range", and delegate called for "editing finished" when you tap within the "in range" area.
I don't see anything promising in Interface Builder, but it's complex enough that I'd like to make sure I'm not reinventing the wheel.
If you don't want to reinvent the wheel, there are several trimmer components on Github.
I have made one myself that you can find here: https://github.com/prynt/PryntTrimmerView
The overall idea is the following:
Use an AVAssetGenerator to generate thumbnails of the video.
When you load the asset, load those thumbnails in a UIScrollView
Put some controls on top of that scrollView
Add pan gestures to control those views.
When you're good, use a size to time equivalence to match the portion selected to the right time range
I'm trying to implement 3D Touch feature that presents a summary of information (like Peek). But I don't want that it pops. I just want to preview the information like contacts app does with contatcs:
It only presents an UIView and doesn't deal with two levels of force (peek and pop).
How can I do something like this?
Ps.: I don't want to deal with long press gesture.
Introduction
Hello
I know this is a bit to late, probably, but in case someone else stumbles upon it: I certainly believe it is possible and I don't think its a "native behavior for contacts". Although it would not be as simple as the UIKit api for peek pop views. You would need to:
Steps
subclass UIGestureRecognizer (perhaps it may work with the UITapGestureRecognizer also), and register UITouches and use their force property.
Setup a UIViewController with transparent but blurred background around the edges (together with a modalPresentationStyle .overCurrentContext if i recall correctly), with your desired content in the middle (much like the peek view). Then add a UIPanGestureRecognizer to the center view for dismissal/sliding up the buttons.
And then create a custom animation transition for that UIViewController to be triggered once the force property of the registered UITouches from the subclassed UIGestureRecognizer is high enough. And then reversed once the force property gets low enough.
Concluding notes
I believe this is a bit of a tedious task and there might be a simpler way. For example, a simpler way using a 3rd party library for long pressure gestures (that registers size of the touch), but it would not give the same feel.
I wonder which component is being used to create a selector option like the one used in iBooks where we can adjust the Font Size and also the Theme, but without moving to a new view controller.
In my application I would like to implement it giving 3 small options to the user to choose, but without moving the view controller being presented. Its a small square area with an arrow at the bottom or top side giving the impression where it's coming from. (Let me know if I am not clear with the explanation).
Does anybody know how to use it??
Thank you all in advance
ibooks is using UIView. In that UIView you can add any controls you like. You need to use delegate methods so that I can perform communication between two objects(send message to another object). You will be able to make you custom UIView as controls.
I am newbi to iphone apps as well as to this forum.
I want to place a background texture for my UIView that should cover the whole iPhone screen. I have controls placed on this view currently. Later on, I would like all my controls to be transparent, so user must be able to work with controls, but not see anything except its text.
Here is what I tried:
Created a UIView derived view - with simple background color, no image
Placed my controls - UIButtons, labels
Programmed all of them correctly to reflect my game logic
Now I have a change of my mind. I think its lot better to have a background texture for my view, as well as controls.
1) I tried things mentioned at: Adding A Background Image In Interface Builder
but this covers my UI controls.
2) Through Interface builder, I tried drag-dropping the texture image onto my view (which in turn, probably, created a UIImageview with background image = my texture). But that again hid every of my past work.
Then I started playing with alpha value (0.1, 0.8 etc) - it gives me some result, but I am no longer able to design my controls. Nor I am able to click (=touch) them at runtime anymore.
Please give me a method that will not disrupt my work so far (I hate redoing all the outlet wiring of my controls), but still allow me to achieve my goal.
Forgive me if I asked too silly thing, or did not search enough. This is my first question, and will be glad to try any helpful solution!
Many thanks!
How about:
self.view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:#"texture.png"]];
I have a UIWindow with a hard-coded UIView inside. I'd prefer to keep it that way, is there a nice way to rotate an already visible keyboard? This question asks the same thing, so I guess I'm really asking if the API used by UIViewController to rotate the keyboard is private API. I'm not going to use it if it is, but I'd still be interested in what it is. And how you found out. Thanks!
UIViewController handles the rotation for your, you really should use one. Don't try to reinvent the wheel, stick to the best practices and you will avoid a lot of unnecessary work.
https://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/AppArchitecture/AppArchitecture.html#//apple_ref/doc/uid/TP40007072-CH3-SW18
The UIViewController class is the base class for all view controller
objects. It provides default functionality for loading views,
presenting them, rotating them in response to device rotations, and
several other standard system behaviors