I am able to get reference to the backgroundImageView of the UIAlertView without using private methods etc. But my alpha setting to 1.0 is ignored. The control is still a bit semi-transparent.
Can you help?
UPDATE: I am sorry. The design team provided me with an graphical asset that had already some transparency in it. :(
So actually ,once you get a reference to the background view. You can set its alpha as you wish. Hopefully at least this information will help somebody.
The image used by Apple is already transparent, not the view displaying it.
So you won't be able to "fix" this.
A workaround might be to place another blue view below it with the same rounded corners.
Related
I have a mapview that is being clipped into a circle by the following code.
roundMapView.layer.cornerRadius = roundMapView.frame.size.width/2
roundMapView.clipsToBounds = true
roundMapView.layer.borderWidth = 5.0
The problem I'm having is that outside of the circle, if I tap in the bottom left area, it will send me to the "legal" disclaimer that appears on the map. It seems the map's "Legal" link is clickable, even if it isn't inside the clipped circular mask.
Any way to stop this from happening? It is right next to a button on my UI and is really annoying when it is clicked accidentally.
EDIT: Uploaded two images: One is of the "legal" link I am talking about, the other shows a red dashed circle where the link is clickable even though it isn't in the clip bounds of the mapView.
http://s27.postimg.org/ustcejmcf/Screen_Shot_2015_06_30_at_7_21_51_PM.png
http://s27.postimg.org/f623168kf/Screen_Shot_2015_06_30_at_7_49_43_PM.png
Disclaimer: Not an answer to the question, but could be a serious reason to reconsider whole approach and make question invalid.
You are trying to hide legal information from users. I believe it is something that Apple would try to avoid by all costs. I also would not suggest to do so, as it may have legal implications for developer as well as not pass Apple Review.
JFYI The way how Apple may avoided clipToBounds limitations described here — interaction beyond bounds of uiview
What I would suggest is actually to move link as described here How do you move the legal sign in mapview
I'm currently building an iOS Application for a client and have hit a pretty huge roadblock. I mean, I could write my own UINavigationBar and such but that would cause a lot of issues further down the road.
I have tried everything in my knowledge so far and have spent several hours searching for a solution (overriding the CALayer, using CoreGraphics and pretty much everything else ) and I get the same result. No matter how hard I try to remove the background of the UINavigationBar, it still shows a white background with slight translucency.
I need to have a lot of customisation on the navigation bar (I.E having a gradient going from "blackColor" to "clearColor" and I can't do that if the background of the Navigation Bar refuses to be completely transparent. I have tried copying all of the CALayers from the UINavigationBar layer to a subview I added and it just kept crashing, even when replacing the delegates and superlayer.
I really need help with this. One of the multiple effects I'm trying to achieve are below. (The blue rectangle is not the focus of the image, it's irrelevant.)
To get it completely transparent:
(UINavigationBar.appearance()).translucent = true
(UINavigationBar.appearance()).barTintColor = UIColor.clearColor()
(UINavigationBar.appearance()).backgroundColor = UIColor.clearColor()
(UINavigationBar.appearance()).setBackgroundImage(UIImage(), forBarMetrics: UIBarMetrics.Default)
(UINavigationBar.appearance()).shadowImage = UIImage()
EDIT:
Using iOS 8.3 looking like this:
Or am I missing something?
You are referring to the top Navbar with the back button and Save button right? I'm just confused as to what the blue box on the image is in reference too.
Anyways, this is an extremely hacky approach but could work:
Set the UINavigationBar's alpha to 0. The Back button and Save button will probably also disappear but you could just add labels to the View Controller at the top in the exact same place. The button's should still be functional even though they are "invisible" but the user will still think they are touching them.
Again, very hacky, but you are free to play with the top part of the View then. I'm sure there's a better way to do this but I'm not near a computer with XCode at the moment and can't test it out, and this fix may not even work but I thought I'd offer up a possible temporary solution.
I have a pale green coloured tableview and when I enter Edit mode the reorder controls on the right edge are almost invisible. Can anyone tell me how to either use my own image for this or darken the system image?
I'm answering my own question because I don't want anyone else wasting time on this. You can't change this... I have resorted to switching my TableView's background colour back to white when I enter editing mode. This is yet one more horrible compromise but c'est la vie! Same with the right chevron in the accessoryView. It would seem obvious that one might be able to set this to the colour of their choice. Not so. The only way I found for doing this, simply darkening the chevron, was to subclass a UIControl and write my own drawRect method. Apple has an awful load of money yet cannot appear to employ enough programmers to keep a handle on this sort of very, very simple UI stuff. It appears that the bigger the libraries get the less we are able to actually do with them.
I have been looking for an answer to this question on google and other places, but have not found a helpful answer as of yet.
I am making an app on Xcode 4.6 using storyboards.
When drag and drop a Rounded Rectangle Button, it is fine, but when I change the background, it becomes rectangular with no rounded edges. i just wanted to change the colour of button and not anything more, but keep it rounded as the original buttons. Could someone tell me a simple method to achieve this or give me a detailed instruction as I am using storyboard and I am rather poor with XCode programming, so the little the programming, the better.
Thanks in advance.
You probably should check the UIAppearance Protocol documentation for iOS.
Meanwhile, you can use...
[[UIButton appearance] setTintColor:[UIColor redColor]];
of course, with your color.
UPDATE:
I have used an alternative method as I do not understand the suggestions which were given to me as I am not as knowledgeable about XCode programming and didn't want to take the coding route.
This may be useful for others, but what i done was that I in Photoshop, I filled the background black, used the rounded rectangle tool on the whole background and then filled the rounded rectangle with the button colour. This somewhat gave a rounded shape, but is still not as good as the original rounded buttons provided in XCode.
If anyone has any other solutions, I am free to try them out and will comment and update what I will do.
I will select the best answer by looking at which one was the simplest although I have not used that method
I suggest you to use GradientButtons
http://code.google.com/p/iphonegradientbuttons/downloads/list
1) Define regular buttons in your storyboard files.
2) Change their class to GradientButton.
3) If you want a different color, initialize them in the corresponding view.
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"]];