JSQMessageViewController - outgoing text alignment - jsqmessagesviewcontroller

I would like to set the sender's reply without outgoing avatar, so i setup the outgoing avatar image to nil like below:
self.outgoingAvatarImage = [JSQMessagesAvatarImageFactory
avatarImageWithImage:[UIImage imageNamed:#""]
diameter:kJSQMessagesCollectionViewAvatarSizeDefault];
but it make the outgoing text alignment miss align like the following screen.
outgoing text alignment sample image
, how can i set the alignment to the red line like the screen shot given?
attachment 2

As i'm understanding your question, you should just add following line in viewDidAppear -
self.collectionView.collectionViewLayout.outgoingAvatarViewSize = CGSizeMake(40, 40);
or other required frame ( for width so that you can manage some space )

My problem was the trailing constraints was set to -32, set the constraints to 0 will solve the problem.
Bubble Container trailing setting

Related

two labels horizontally in tableview?

I would like to have two labels in my tableview.
but the label resize option is disabled.
How to have the two labels horizontally?
Select UIlabel instead of the cell and then you can set Auto resize like follow.
You may need AutoLayout and Custom Tableview Call. Use two different labels, e.g. one for username (left aligned text) and another for garbage text (right aligned text).
Now, set Content Compression Resistance Priority for one of both label, according to your requirement for data visibility when there is long texts in user name.
Look at these snapshots:
Labels with default content compression resistance priority
I changed content compression resistance priority for label blablabla blablabla, from 750 to 749.
Result is:
For more details see Apple document: Setting Content-Hugging and Compression-Resistance Priorities
Drag a horizontal UIStackView from object library and set it's constraints like this inside the cell
//
drag 2 labels inside it and make the distribution .FillEqually
//
Are you sure you have selected Label?
If you know about Layout constraints, it will be easier than this auto resizer.
Label 1==> Set Leading, Top & Bottom constraints to SuperView. Set Trailing constraint to Label2.
Label2==> Set Trailing, Top & Bottom constraints to SuperView. Set Trailing constraint to Label2.
Now, after this, it will show Red error arrow. Now, you have to decide which Lable width is a priority. After deciding, select that Lable and set Horizontal Content Hugging to 251(High) and Comprehensive to 751(High). Also, change lower priority label Content Hugging and Comprehensive to 249 and 749 respectively. Now, Red error arrow will not be shown and in the cell it will show all text in both labels without and cut.
if you want a easy and quick fix for it, implement a stack view inside the tableview cell. You can change the stackview as you want and also you dont have to worry about applying constraints.

Changing node box size in Partykit

I'd like to be able to change the size of the box to fit the text using the partykit package. How do I do that? Node Box Size Example
You haven't provided a reproducible example and hence I'm not 100% sure - but I think the plot you have created used the node_terminal() panel-generating function to draw the terminal nodes, see ?node_terminal for more details.
By default, the function automatically determines the height/width of the boxes depending on the character labels that are going to be drawn. It uses length(label) + 1 lines as the height and the maximum of nchar(label) as the width. However, you can easily change the height/width by plot(..., tp_args = list(height = ..., width = ...)) to values that you find more suitable.

Why am I getting three dots in Auto Layout?

I tried doing auto layout but I keep on getting three dots. How do I fix this?
Screen shot of how it looks below.
Just pinned both edges to 0 to get max width for label regarding screen sizes...and still content is too long then it displays 3 dots as per option truncate tail...For that you have to make a font size bit smaller or make multiline label...

Setting font size based on line height in NSTextField

I have an NSTextField where the font used can be changed by the user.
Although the font's point size remains the same, the actual height of the font is much bigger for some fonts. This means if the user changes the font to 'Zapfino' for example, most of the text is cropped. I would like it so the text in the box always looks roughly the same size.
Also the line height seems to change depending on which font is used meaning they don't line up well and sometimes get pushed down and the bottom gets cropped off.
How can I keep the text size and line height looking the same?
You need NSTextField which is using single line. You can do it in Attributes inspector by checking Uses Single Line Mode.
How to do it:
And now Your text will be like this:
Do programatically:
To change NSTextField height programatically by font size or scale the text to fit the bounds example here.

BIRT -line spacing in report design

I wonder how to define the line spacing in a multi-line lable or text item for pdf output. While increasing the line height within a style works fine, decreasing the height to reduce line spacing doesn't seem to work.
Any suggestions on how to reduce the line pitch?
Thanks
Try removing top and bottom padding. I don't know about labels and text items, and maybe it's not the same, but I had a similar problem in a table with 8pt font in the details. It would look fine in HTML, but in PDF the space between the lines would be huge.
A good trick is to set background colors on the item and the surrounding cell and whatever other elements you have and you'll be able to see which element steals the space.
Then tweak the paddings, line height and font size to reduce the extra space as much as possible. Use the 'Advanced' properties panel (or preferably stylesheets), as line height is not available in 'General' for some elements.
I managed to get my table looking great doing this if I removed ALL top and bottom padding (from row, cell and data element), used a row line height of 10pt and a font size of 8pt.
There seems to be a bug that causes the actual text inside the data element to be somehow padded at the top no matter what in PDF. If you color the data element background and then select the text in the report, you'll see that the text is set too low on the element, overflowing a little at the bottom. Thats the reason 8pt font and 8pt line height wouldn't work for me, it would cut off the bottom of the text.

Resources