All rows in UILabel not visible depending on text - ios

I have a label that goes across the screen with a margin of 20 on each side and the line attribute is set to 0
This is what it looks like in Interface Builder
There is no problem if the text fits on a single row but if it needs another row, then the second row isn't always visible.
If I use the text and the image above, then the result looks like this in the simulator
But if I add some more text then the second row is visible.
Interface Builder:
iOS Simulator:
Am I missing something with the constraints?
You can download the project here and try for yourself. I've added a textview and a button to easier debug it.

You can calculate the desired height in code. It's just a few lines.
https://gist.github.com/danielphillips/1005520
credit DanielPhillips

Related

Textfield Connecting and Labels

I have always had this problem and could never figure out how to solve it. My issue is that I want to produce a similar thing as the photo: Image
I want to be able to have text fields connect like this and be able to have a 'label' on the left while still being able to input on the right. Any help is greatly appreciated.
If I am not mistaken, I think that what you want is to have a label on the left and a textview on the right. The image you have supplied looks like the textViews and labels reside within a UITableView controller as static cells. What they have most likely have done here is simply extended the label from the left to the centre and the textview from the right to the centre, such that each takes up half the cell (and added constraints). Then you can set the text alignment to left for the label and right for the textview. The final thing you should do is get rid of the border of the textview, which can be found in the attributes inspector and is called Border Style. You want to set it to the far left option, like this:
As the background of the cell is white and the textview's also, you shouldn't need to change it, but if you do there is an attribute for that a bit further down that you can have a play with.

iOS - increase UITextField height based on its content

I've a collection view that has on its header some views as user inputs.
In one of them I've something like a Biography textField, but when I'm typing the text continues all the way to the left, and what I'm trying to achieve is that when the text reaches the visible end, it goes to a new like and so it increases its own height.
How can I achieve this?
I want the Bio text field to increase its height based on its text and not stay the same height and the text goes all the way long to the left.
Regards ;)
UITextField is one-line only element. You can try UITextView instead
EDITED
I've never done this, but this thread seems to do something like dynamic size with UITextView

Method to display UILabels and UIButtons Inline with each Other

In my app I have a "summary" paragraph that based on data an user actions in the app changes what it displays. The issue is it displays both regular text and clickable text (like a button) in the same sentence and line. The app will have a series of if else statements and based on the results of these the text that will be displayed is determined, but how do you make some of the text a button tied to an action and some of the text a plain label? Any and all help is appreciated!
In iOS 7, buttons look like blue text. I would suggest taking advantage of that fact.
I would use AutoLayout, and create your fields with constraints that put a very small amount of space between each label and button in your line of text/labels, with a vertical constraint on all of them that aligns their leading to match.

animation for the label that have content with length more than its own width

Is there in ios something like android:ellipsize="marquee" like in android?
I need to make text scrolling animation for label but I didn't find a way for doing it.
EDIT:
# Tomasz Wojtkowiak :
many thanks for your recommendations.
PROBLEM:
I have a label with a define width in pixels and the text that should be displayed in this label, and this text have for example double label width. I don't want to clip/wrap/trancate, I need to show the full message. In android for the TextView there is a tag android:ellipsize="marquee" and in the above described case the text in the label will be autoscrolled from left to write(some kind of animation).
How can I do the such behavior in ios?
Thanks in advance.
Kindly try this JHTickerView.
It is an open source project.. It has custom UILabel (UITickerView) that has a property as you expect! that is the label will marquee the given text to the it.

Stop image expanding in multiline table row? #2

[Ok I've had to ask this question again as the first time I was unregistered, and I can't seem to register and link my fb id to that account/or give feedback on my question otherwise! Any way here's the original question, and extra info - original url: Stop image expanding in multiline table row? ]
I'm having problems implementing a table row that allows text to wrap to multiple lines, and also has an image on the left, and a disclosure accessory on the right.
The multiline text is fine but the imageView expands to the right when there is more than one line of text. I want images in all rows to be the same size. I've tried setting the autoresizingMask to UIViewAutoresizingNone but this doesn't seem to work.. Do I need to use the contentView, or a nib file?
Any help/example code appreciated!
EXTRA: HaveYouMetPrabu's answer to my original question kinda worked - but so did my current code UNTIL I changed the row height in heightForRowAtIndex path for rows with more than one line of text (even using an autoresizingMask of UIViewAutoresizingNone) - then the image expands to the right. So I think the solution needs to include both the cellForRow.. & heightForRow.. methods. My current heightForRow.. implementation is probably too simple just switching between 2 fixed row heights depending on the text length..?

Resources