Uitextview expand to right - objective-c

I have a uitextview in a tableviewcell, and I would like to know, how can I get the textview to expand to the right (ie let me keep typing without making line breaks and doing the scrolling thing). thanks

For every container, just like this one, you can set the maximumNumberOfLines to 1, which will limit the number of line breaks.

you can do it simple by set max number of lines
textview.textContainer.maximumNumberOfLines=1;

Related

Add lines of text to subtitle of Xcode UITableView

I am using master/detail template in Xcode. I can add text into the maintitle and the subtitle of the table view.
The subtitle only shows one line of text with ... at the end.
I understand that it is telling me that more text is available.
How would I have it give me 2 or maybe 3 lines of text before the ... I tried making the cell larger, but that had no affect.
I don't see any parameters that will increase the number of lines.
thanks
The default cell give you a label with just one line, if you want change it you will need to create your own custom UITableViewCell and add a label wit the number of lines you need:
Customizing UITableViewCells

How can i achieve Multiline UILabel with NSLineBreakByTruncatingMiddle and sizeToFit in autolayout?

I have a two line UILabel. I want its line break mode NSLineBreakByTruncatingMiddle. The problem i am getting is if text is small enough to fit in one line, its showing it in middle of label instead of at top. I am using iOS6 and autolayout so sizeToFit is not working for me.
How can i achieve this? I want if text is small to fit one line it should be vertically top aligned. I have tried this, but its truncating and showing the text in one line only rather than two line.
You need to calculate the required size and update the frame of your label:
CGSize s = [myLabelString sizeWithFont:...
constrainedToSize:CGSizeMake(..., MAXFLOAT)
lineBreakMode:NSLineBreakByTruncatingMiddle];
With whatever font your label is using and its width.

Scrolling NSString in NSView

I'm using the method posted here to scroll an NSString across the screen. However, as shown in the image below, the string doesn't seem to be drawing correctly. Anyone have any ideas? Thanks.
EDIT: I forgot to mention that I modified the scrolling text class to use an attributed string rather than a regular string.
EDIT 2: I think the problem is that the string is repeating before it can finish the first time. How can I add some spacing before the string repeats itself?
Try clearing the area before drawing by adding
NSRectFillUsingOperation(dirtyRect, NSCompositeClear);
at the beginning of drawRect:.
I figured it out. I had to change this line in drawRect::
otherPoint.x += dirtyRect.size.width;
to
otherPoint.x += (stringWidth + 20.0);
EDIT: You can change 20.0 depending on how much of a gap you want before the string repeats.

MS Access Draw line around detail section that can grow

This really shouldn't be hard, I just can't figure out how to do it.
I am making a proposal report that needs to have a border around it. The problem is to get the vertical lines on the side. I can't figure out how to get a line to grow and shrink based on the height of the detail section.
I have used Crystal reports and sure wish Microsoft would learn a few things in regards to MS Access report writing!
I am very comfortable with VBA so have no fears there.
You were right, this isn't so hard. The trick is to use 2 variables, top and bottom. In the PageHeader_Format event you set top to Me.Height, and in the PageFooter_Format event you set the bottom to Me.Top - correction, where correction is a fixed amound you use to fix the right length. I´m not sure where this amount comes from, you just have to try a little bit.
In the Report_Page event you can then draw your line from top to bottom.
Another method that nobody has mentioned is the one using the Line method of the report, outlined in Knowledge Base article 210321. I've used this one for years, and it can be used to draw both lines and rectangles. It's quite handy for invoices that have variable height subreports for the invoice details, but need the vertical lines to change according to the height of the main report detail.
No VBA needed.
Make a dummy grouping that is unique to each detail. For that grouping, set footer to yes.
In your new group footer section that you just created, add your line.
In your detail section, select all the relevant fields that can grow and set Can Grow = Yes
Done!
Edit
Off-topic, I agree that Access Reports could learn a lesson or two from Crystal. But Crystal isn't perfect either. [/flamewar]
Try this one.
Right click on the detail bar and select properties. Set the special effect to “Sunken”. This will put kind of a border around the detail section that resizes with the detail section.
I have tried to get a line to dynamically resize but its catch 22, by the time you know the height of the section (In the On Print event) you cant make any changes!
use the page event coupled with me.line and scaleheight / scalewidth.
I draw a box around the whole page with the following. Play with it and see where you end up. It is very handy for making professional reports. If you want a line in a certain place on a report you can use the controls coordinates. like
me.line(Mycontrol.left,mycontrol.top) - (myothercontrol.left+myothercontrol.width, myother control.top + myothercontrol.height)
Private Sub Report_Page()
Me.Line (0, 0)-(scalewidth -30, scaleheight-30), 0, B
End Sub

Labelsize appears bigger in VB.Net

I'm trying to stack a few lists on top of each other. But the label.size.height appears to be bigger then the label itself.
When i set the borderstyle to fixedsingle, i see the border around the text. But the height is bigger, so there comes a space between one label and the next.
I have tried to set margin and padding to 0 without result.
Exemple: label.size.height return 23, when the height actually is something around 15.
Does someone knows how i get the right size?
Edit:
When i explicitly set the height of the lable, the problem is solved. Is this some problem with autosize?
I had encounter this kind of problem earlier. The label height oscillated between 17 and 23. But, my labels were placed inside a TableLayoutPanel and so how I fixed it :), by making changes in Designer.cs
HTH