Scrolling png with text & alpha on top of a static UIImageView - iphone

I have a view controller that has a view structure as follows:
FilesOwner
FirstResponder
View
ImageView (.jpg)
ScrollView
ImageView (.png)
The text in the innermost imageview has white text and clear (alpha) all around. I want to scroll the innermost imageview, and see the background image (the .jpg) behind it.
Its not working. Its acting like the scrollview background obscures the underneath .jpg. I say this because if I change the background color of the scrollview, that's what I see i.e. if I set it black, I see black behind my .png, if I set it white, I see white. If I change the alpha of the scrollview that doesn't seem to work either. The one other thing I tried was unchecking drawing: Opaque, but that doesn't get it either.

Try setting the alpha value of your scrollviews background color to 0 (not the alpha value of the scrollview itself). The scrollview should be set to not opaque.
(didn't try, just guessing...)

Related

Gradient background not working if we replace an UIView instead of UIImageView in HeaderExample of Parchment

I am using parchment library for pagination in my application. When I replace the UIImageView with a UIView in the header example of Parchment, gradient background is not working. I only see white screen.
Gradient works if I add separately in a view, with Parchment, I believe it is overlapped by some layer. I also tried this link but did not work.
https://github.com/rechsteiner/Parchment/issues/181
Actual result is a white screen in the header view, expected is the gradient fill.
The UIImageView.... if the gradient is being displayed as a bitmap in the .image of the UIImageView, that would explain the gradient disappearing.
UIView’s do not have a .image - That is why UIImageViews are needed to display bitmaps.

UIImageView changes its size when contentmode is Scale to fill

I have a UIImageView embedded inside a view. I have constraints that declare that the image view is Trailing, Leading and top spaces are 0 relative to its superview. My Button space is 20. However, when I run the app, and declare the image view content mode to be scale to fill, the 20 space from the button view becomes 0 as well, meaning it stretches itself to the superview frame, which is not desired.
what can I do to keep it in place like defined in the constraints?
I solved this by clicking on "Clip to bounds" in the image inspector in storyboard.

Making font colour negative to the background. iOS

I want to make text in a UILabel appear of a color negative to that background it is placed on.
I am placing the label on a web view, and I want that label to be always of a negative colour to the background so that no matter what colour (when web view is scrolled) is exactly below the text, it is always visible in a negative colour.
Thank you.
I don't recommend you to do that because the scrolling part of the webView won't be smooth with all those calculations in it. So I suggest you to set a background ImageView to your label and set a image with a negative color to your font color to that ImageView
An alternative would be setting the shadowColor to the opposite of the textColor (for example, white and black, respectively), ensuring that you'll always be able to pick out the text regardless of the web view's background color.
Don't forget to set the shadowOffset too!

What's this UI element?

What's the UI element that is top of that number buttons to display number ? (which is in light blue color)
It looks like a UINavigationBar with a prompt. However, the location of the gloss (which differs from your typical UINavigationBar) and the centering of the numbers (not shown) makes me think it is a custom view.
If you're trying to replicate it, I'd suggest starting with a UIView. Add a UIImageView with appropriate image for the the blue background and a UILabel for the text. Or, instead of the UIImageView, you could draw the background in the UIView's drawRect: method.

Why does UIImageView appear to be partially transparent

I have a simple app that just displays a UIImageView. For some reason the image appears that it is partially transparent as it is much lighter than if I view the same image in photoshop. Any suggestions...I though by default a UIView is opaque.
You have probably changed the alpha of your imageView or the view itself. check for the the transparency of your imageview also. Because the default alpha of the imageview is 1 and opacity is also set to 100%. You might have chane one of these otherwise this is the problem of your image only
I don't believe that UIImageView is by default partially transparent? Try changing the background colour of the application and see if that affects the outcome of your image, if it is transparent it should be darker with a black background rather than white.