I a trying to do an uibutton with image and text, in xib it looks fine but in the simulator the image is missing, and I don't know why.
xib:
the uibutton settings:
the look in simulator:
Simple way is to take UIView and add UIImageView,UILabel as SubView using interface builder. Then add a transparent button all over the UIView. I hope your problem will be solved.
Related
Is there a way to show a UIImageView in front of a UIView (for Preview live)?
I try to make a camera based application so when clicking on a button the app take a pic and show it into UIImageView.
[myView addSubview: myImageView]
should work fine. if not please post your code.
If you are adding the view programmatically the previous suggestion should do it. If the views are in a storyboard or XIB and you want to move it to the front, try this:
[self.view bringSubViewToFront:myImageView];
You might want to use UIKit Peek and Pop if you are on iOS 9 or above.
Also there is this tutorial: http://useyourloaf.com/blog/3d-touch-peek-and-pop/
I added a UIImageView to my View Controller's main view using interface builder.
Then I just set the image of the UIImageView in the properties.
When I run the app I can't see the image. What can be wrong? Thanks
PS. On the XIB file, if I select the image, I can see it - once I remove focus
from it, it seems like it went to the "back" of the main view (because it is still there, I can see it in the "Objects" window of the XIB file).
pps. It works if I use a different image. Could it be that it was because previous image was with transparent background? (although it still had some icon).
I have created few thumbnails of images dynamically and i want to display detail description about that image in other viewcontroller when the respective image is clicked. I am using Storyboard (universal) in Xcode 4.6.
I am new to Xcode can anyone suggest me how to create segue for transitioning to new View Controller when the image is clicked or tapped
Any suggestions or examples will be appreciated.
Thanks in Advance.
Edit:
I am not able to get the click on the uiimageview which is subview of the uiscrollview and the images are created dynamically.
Also wanted to know that is there a way by which i can come to know which image is being clicked.
I have a UIButton on top of a UIWebView. The UIButton is supposed to look like it's native to the webpage. However, when I zoom in on the UIWebView, the button comes with it, obviously looking out of place. Is there a way to keep the button's position relative to the UIWebView rather than its position on screen?
Thanks for any help!
Not sure I've understood your problem, but here goes:
You've likely a view hierarchy like this:
View
UIWebView
UIButton
That is, your button was added as subview to the UIWebView. Since the UIWebView is also a UIScrollView you get the behavior you've observed. To fix it, make the button a sibling, not a child:
View
UIWebView
UIButton
It will still be drawn in front of your UIWebView if it was added after the UIWebView.
My problem is that I want to rotate the UIImageView of a UIButton.
The transformation itself is pretty easy:
super.imageView.transform = CGAffineTransformMakeRotation((M_PI*120)/180);
(I subclass a button, but it doesn't work with a normal button either.)
So, it rotates but looks not very pretty: http://img534.imageshack.us/img534/2796/afterh.png
As reference, this is the same imageView but not rotated:
http:// img704.imageshack.us/img704/1299/beforen.png (sorry for that whitespace, I'm new and can just post one link...)
Thanks for your help
Sebastian
Okay, i finally got it.
It was needed to set the clipsToBounds property of the imageView to NO.
Sebstian