I have a problem to show my object field Description on Cross Platform Label . Description has many hashtag, that need to be clicked and open another page. Here is my example :
"I have some #issues that need to be #solved maybe Xamarin#Support can help me."
That is my description, and i want to put it on Label. How can i set those hashtag (#issues, #solved, #Support) to be clickable?
One option is to use a WebView and use simple HTML / CSS. This would give you the most flexibility and in some cases is the simplest.
Another option would be to write custom renderers. There are plenty of answers out there on how to do this natively but as a starting point.
On Android you need to use a TextView with autoLink="web".
On iOS, a UILabel should allow you to do this.
You can change color, ForegroundColor, FontAttributes of the hashtags by using Span in the label. Sadly, Span doesn't have GestureRecognizers.
I suggest you to stack multiple labels and add TapGestureRecognizer on the label with hashtags.
Related
If I make button relatively small, it's caption turns to ellipsis.
How to turn off this feature?
Don't let the button go below it's preferred size, then it will never need to elide the text of the button label:
button.setMinSize(Button.USE_PREF_SIZE, Button.USE_PREF_SIZE);
I want to make very small button
You can use any of the below either separately or in combination:
Apply CSS to use a very small font in the button.
Make the label text for the button very short.
Use brian's answer which proposes explicitly setting the ellipse string to empty.
Use a small graphic icon instead of text.
You can use setMinSize as documented above in all cases (if you wish the button not to go below a preferred size truncating or eliding content).
In all cases, if you wish, you can also apply CSS to minimize the padding between the label and button the border.
From your previous comment (I want to use simple captions like "<" and ">"), I think option 2 (Make the label text for the button very short) is what you want.
You may also be interested in Joel's Designing for People Who Have Better Things To Do With Their Lives which would indicate, usability-wise that very small buttons are usually a pretty bad idea.
in your label/button you can use the textOverrun property to turn off ellipsis.
textOverrun.set(OverrunStyle.CLIP);
this is probably a bit late for you, so i am putting it here for lone wanderers digging up this question.
It puts ... because there's no room for the text. You can use bigger buttons or a smaller font but if you really want the dots gone use button.setEllipsisString(""); , but then you just get truncated text.
i am using xamarin to code the project. Now i encounter one issue which is, i added one tool bar item with text, if it is showing the short text it is fine, however if the text is too long, the tool bar item text is showing the behind value since it is too long. for eg "today i want to play football with peter", the xamarin show "play football with peter", however i want to show the front value which is "today i want to play",is it able to achieve it? or i am required to do a substring?
If you are using Xamarin Forms, there is no way to control this (currently). The underlying logic used to abbreviate a string is controlled by the platform, and Forms does not expose any control over this for Toolbar items.
You could write a custom renderer that used the underlying platform API to control how a string is abbreviated. However, it would probably be much easier to just use shorter strings for ToolbarItems that did not require abbreviation.
Currently, it appears like a square with no text beside, we want to customize the look & feel without disturbing the icon of course to match our other buttons.
Already tried adding styles to the div which is converted to the share icon, but unsuccessful so far.
<div id='widget-div' class='btn btn-blue'>Google Classroom</div>
The above line renders as below :
Any idea how to proceed further or which direction to look into ?
To get a completely different share button you will need to write your own JS to style the button correctly, handle the mouse click, etc., and then direct the user to a URL of the form https://classroom.google.com/share?url=https://foo.com/ (source). (You'll need to following the branding guidelines too.)
To modify the button you can refer to the Share button documentation. However, there are some restrictions that you would need to follow to modify the Classroom button in the appropriate way.
Here you can find all the specifications and restrictions to the logo. Check if these specifications allow you to modify the logo accordingly to your needs.
You can put the white logo (square or circle) on a colored background of your choice. Full brand guidelines here
I have two questions that you hopefully can help me with:
I'm struggeling with BorderBrush property and I need to be able to set it in code. It works if I do it like below but I need to give it a haxadecimal value (#ffcccccc) and can't figure out how to do it.
datePicker1.BorderBrush = (SolidColorBrush)Application.Current.Resources["PhoneAccentBrush"];
I have a datePicker and would like to give it a border color and set the background in the same way as my TextBox fields but I'm failing. What is the trick in modifying this control? I would prefer if I didn't have to use Blend.
Use Color.FromArgb
You have to customize the DatePicker template. This is of course, easiest done using Expression Blend. If you're clueless about XAML, I'll recommend you don't do custom control styles unless you have studied the subject more.
I feel kind of silly asking this question as it seems really simple, but how do I create a text box that I can type in instructions and stuff like that. I don't need the user to be able to change it, it is just to give instructions. I tried the label, but it only allows one line. I need something that can allow about a paragraph or so. Similar to the box in an installer that describes what the program does. What did I miss?
You can use a label but set its AutoSize property to false. This allows you to size the label as you wish and it will automatically wrap the text to fit.
You can also anchor the label to the parent form to have it automatically resize and reflow the text if the user resizes the parent form.
You want a text box, but set its Read Only property to TRUE, and maybe Enabled to FALSE