sorry, if this might been asked before.
I am laying out a viewcontroller for a new app. It will include a photo (UIImageview) which fills the nearly all of the screen and it should include a scrollable UITextview which should fill the bottom right corner of the screen and including a description of the photo.
So i have two views over one space and i would like to give the Textview priority over the UIimage. Is there any other way then reducing "Alpha" of the UIImage to make the Textview visible ? Tinkered around with Conten Hugging Priority and Content Compression ... to no avail.
Any help would be appreciated
Thanks
The easiest way to make sure text is easily readable over any image, I suggest setting a background of color rgba(.2, .2, .2, .8) or something similar and then using a white font color.
Thanks everybody for trying to help me out... I have found the solution... It is perfectly ok to overlay Views in Interfacebuilder but then it is imperative to use a background color for the overlaying textview with reduced opacity.
Related
Currently, I have a UIButton and want to set an image inside of it. I'm successfully able to set the image to inside the UIButton but for some reason, the image is VERY small compared to the UIButton. I want to increase the size of the image - no, not cover the entire button just a slight increase so it's a bit more visible on the UI.
More information, my UIButton is 40x40. The answers I've seen on StackOverFlow have indicated changing the Content Mode but even those answers have not helped. I'm a little stuck at this point so any expertise/advice would be highly appreciated!
Figured it out. I had to use image insets. This property allows to reposition the drawing rectangle for the button image. By setting values to the top, bottom, left, and right image insets we're creating a rectangle and thus, increasing the space for our image to be draw in.
I had actually seen this suggestion in other answers and had tried it but on IB, nothing seemed to change but I finally decided to test it on simulator and saw the affects.
Background : I am stacking a couple buttons and a label within a view over an image with some visual effect views for blurring.
Conundrum : The text in the buttons and in the label are pixelated while other text is crisp and sharp. It's almost as if the label and buttons have been converted into a badly rendered image.
DoneDid :
Put the buttons and label in it's own view.
Put the view with label and buttons outside of the Visual Effects view stack.
Played with the font, scale, various other settings.
Set the background of the "Inventory Details Bar" to a solid color to check for potential FX leaking up to the overlying view.
Looked all over for "blurry text over visual effect view" and several variations of the sort. Nothing that quite matches my current experience.
As always, this community is awesome and I appreciate any ideas that might break through this visual odditiy.
Inventory Type label is the thing we are looking at
Label details (tried several fonts, not just Arial)
Blurry "Inventory Type" label
3 hours researching,
post for help...
Found the issue a moment later.
Ok, so the view that contains the image stack with blurring effects, including the label and the background images, has a shadow that I throw over the scrolling cells below it.
In looking for a solution to dealing with the layer shadow, someone had mentioned rasterizing the whole view to make it more efficient. Which means.... it turns the whole view and its contents into an image of sorts to lower processing resources.
It was...
(detailedImageView being the name of the parent UIView)
detailedImageView.layer.shouldRasterize = true
I changed it to "False" which is the default for this parameter and BAM... sharp and crisp text.
I hope this helps someone.
well am trying to make this UI :
the above UI contains a ProgressView on UITableViewCell and the vertical line is a UIView (if i should use something else then a UIView for this vertical line then please do provide your suggestions ) well am stuck in moving this vertical line ? how can i place this line at the point where the bar is filled as shown in the image , if anybody knows then please let me it'll be so helpful for me
the pseudocode for what i need will be like
verticleLine.xAxisPostion = progressBar.progress.xAxis
Trying to think out of the box here: maybe you could use a UISlider instead with userInteractionEnabled set to false? With UISlider you can specify not only the track color, but also the thumb image (being a tiny plain grey vertical bar in your case).
To expand a little bit: you set the minimumTrackTintColor to green, the maximumTrackTintColor to red (or stretchable images for minimum/maximumTrackImage), minimumValue to 0, maximumValue to 1. Instead of progress you can now use value — and it should give you roughly the same behaviour with the thumb (grey bar) following the value.
the above UI contains a ProgressView
Don't use a UIProgressView. Just create your own self-drawing view that looks exactly the way you want it to. The view that you've designed — green to the left of the progress point, red to the right of the progress point, and a vertical line right at the progress point — is trivial to draw, and trivial to redraw when progress happens (i.e. when the value changes).
I'm struggling with a problem:
I did create an UIView with subviews inside to make my own UIToolBar.
I added a UIView which acts like a delimiter line on top of it.
Then I decided to make one of the subviews rounded on center. But I need to find a way to "curve" the delimiter UIView.
Actually I have:
I want:
Is there anyway to fullfill my goal programmaticaly in swift ?
I thought about importing an UIImageView and make the images according to the differents iPhone size but is there any other solution ?
I solved a similar problem by sandwiching a dark gray circle image behind the toolbar, and a light gray circle image in front of the toolbar but behind the button. It's a hack but it works perfectly if you match the colors, and it's easier than doing path drawing.
How do you add a simple two color gradient as background to a UICollectionView. It should cover the whole background and stay fixed even when scrolling the collection view (horizontally).
All layer based solutions I tried so far had issues regarding not covering the whole screen and covering only the initially visible frame. Bonus points for being animatable and not using images ... ;)
What's the best way to do this?
An easy and fast solution is to set the background color of the UICollectionView to 'clear' and add another UIView with the gradient behind it.