Changing UILabel alignment - rubymotion

Is there a way to align the UILabel when using Formotion forms?
I asked this question on Formotion GitHub project, pasting more details here - https://github.com/clayallsopp/formotion/issues/181
In this case I want to right align the UILabel.

There is a text_alignment option
There is also the textAlignment property on UITextField (#form.row(:email).text_field.textAlignment), which you can set to NSTextAlignmentRight
If you're trying to align the cell's label, you will likely just have to change the frames of the cell's subviews.

Related

ChartJS: add a clickable text in title

I am using ChartJS to draw a line chart. I want to update the chart with the different dataset but that is another case. Right now i am having trouble in adding a button in the title because no callback function is available for this. Any thing from i can get help ?
According to this issue on github.
There are two points mentioned:
1- You cannot have a hyperlink inside the canvas.
2- There is a solution to make title clickable but this makes whole one point to another point clickable not only text but the white space also.
My solution : what I did was to use a simple hack; I hide the title by giving it display :false and then add an external link to it. Line adding a link into the div. And upon clicking it I was changing the chart.
You can control the chart by using any external element but there are some limitation on manipulating the chart from the elements of the charts itself.
I hope it may help the future readers.

UITextView text color when Editable attribute is disabled

I migrated an app to Swift 3. I've managed all the changes but I'm struggling with this particular problem. I have some UITextView in a UITable with are populated with some email address.
In my old Swift 2 version, these views where not editable, with the link data detection enabled. However, after the migration, with the "not editable" version the text inside the text views is displayed in white color. If if re-activeate the "Editable" option, the view content turns again to black.
What is the dataDetectorType that you are using? If you are using link, you can either change the tintColor, or you can use linkTextAttributes to manipulate the style to your liking

C++ Builder XE6 Firemonkey - How to align a column to right in TStringGrid

Could anyone tell me please how can I align one or two columns within a StringGrid as TStringColumn doesn't have text settings but TStringGrid has. When I align grom TStringGrid text settings unfortunately it align all columns..
Or does anyone can give me a sample example how to use TGrid object..
Thanks

Changing backgroundcolor of a table-cell based on its value

I'm using this nice tool pod to generate ODT-Files in my django-application. Is there a way to change the backgroundcolor of a table-cell based on its value?
Sure, in LibreOffice its easily found on the menu.
Format -> Conditional Formatting.
You could generate a tag for the color in your django application and then have a post process LibreOffic Writer macro going through the tags and change the background color of the cells accordingly.

Best way to display static text in a view RubyMotion

I have a two view app. The root view has items that simply have a details view. In that details view is a simple section label (the item name) followed by a paragraph description.
What is the best way to display this static text? Is the best option UILabel?
Usually a UILabel works fine. Make sure you set the lineBreakMode to zero (0) so it will wrap.