Autolayout Constraint to UITextView to wrap text around UIImageView - ios

I am trying to achieve something like mentioned in the image below,
Here we have two components,
UIImageView &
UITextView
Is there a way to wrap the text of UITextView to wrap around the UIImageView, using Autolayout?
Any help would be appreciated. Thanks in advance.
It is shown in one of the raywenderlich.com youtube tutorial channels. You could find it here,
https://youtu.be/m6mvOmPYNA8?t=13m53s

Related

Text over image in Uiview

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.

UILabel fit to text and positioned in a correct way

If you first take a look at the following screenshot.
Like you can see, I have a custom cell with on top an UIImageView, A UILabel, An UIimageview and another UILabel
The first UIImageView should always stick to the right. That's not a problem for me.
I can't figure it out how to fix my 2 UILabels and the snake-like image. These should follow up each other with always the same margin between them. The two UILabel always contains names of people. So if my first UILabel contains a very long name, it should also looks nice.
You can compare it a little bit with what Facebook is doing.
Now my question is, how can I achieve this? I'm trying to work with autolayout.

Using UITextView

I am trying to create a textview that holds a 3 line string. As the user works, the string will update and become wider, the height (number of lines) will remain the same. Reading through the documentation I understand that the size of the container cannot change, it is readonly.
I have code that places text into the text property of a UITextView but it will not scroll the text right or left. I played around with inserting a UIView into the textview and believe that will work, but doesn’t seem like the way to about this. I’m kind of figuring that I need a custom UITextView class and a custom NSTextContainer. Wondering if the proper direction? Any help is appreciated.
Thanks,
Jeff

UILabel auto resize and add scroll bar if necessary?

I've looked around for an answer here but didn't come along one that really helped me. directing me to a proper answer I may have missed is greatly appreciated too.
I have a label defined in the simplest manner :
IBOutlet UILabel *eventIDLabel;
IBOutlet UILabel *eventTitleLabel;
IBOutlet UILabel *eventDescriptionLabel;
now the description label can vary in content. May have 1 line or multiple lines. I want the label to resize automatically. Now I also want that if more lines than current screen can show, user is enable to scroll down and see the whole content of label.
Very trivial question probably but I am really new and hoping you guys could help.
thanks :D
You could use a UITextView. UITextView automatically can be scrolled, when the entered text ist to long.
You can use [myLabel sizeToFit]
You can also read more about it here
Also if you know it's going to be relatively long, you can consider using TextView which will provide the text scrolling
Hope I helped

iOS UITableView cell layout questions

I have a chat on a web site that looks like this.
I am now building an iPhone app for this and have some problems creating the same layout. I hope you can point me in the right direction. Is subviews or webviews the best choice?
If using UIView, UILabel and UIImage, what is the best way to make rounded corners and the little arrow. The gradient background should not scroll with the table view. What's the easiest way to calculate the hight of each message? What is the best way to async load the images over http?
If using a webview, what is the best way to populate it with data? Building string? Having a template and populate the image, username, time and message thru JavaScript? How can I resize the UITableCell and UIWebView to fit the contests?
Will a table full of UIWebView be much slower than using labels? Will I need to create it twice to return the height of the cell in heightForCellAtIndexPath and add it in cellForRowAtIndexPath?
Thanks for your help!
If you wish to see it live, visit www.aktieguiden.com
This is really a lot more than two questions, and I'll answer several of them.
I would use a table view with a resizable UIImage and a UITextView for each bubble. Use an image of the bubble in png with a transparent background, and make it resizable. Import it with UIImage's -(UIImage*)resizableImageWithCapInsets:(UIEdgeInsets)capInsets. To determine a height, UITextView has a contentSize property which will tell you the size of the view that can be scrolled. For asynchronous loading, use one of the many tutorials or frameworks for that purpose. Here is one:
http://developers.enormego.com/view/what_if_images_on_the_iphone_were_as_easy_as_html

Resources