How to support right-to-left in xamarin.forms - internationalization

How do I support right-to-left direction of pages in xamarin.forms? I have tried different layouts such as RelativeLayout and StackLayout and set its HorizontalOptions to start or end, but it does not swap the element. Anybody have any idea how we can achieve this?

Xamarin have started (or at least announced) work on internationalisation, including RTL. Currently it is not in yet though. A workaround for this in e.g. ListView is to create multiple list item templates with LTR/RTL directions and use them according to the current UI culture. For other controls your best bet would be to implement a renderer for each control type and change its HorizontalOptions or XAlignment according to the UI culture. You're basically forced to roll your own.

i have create custom markup extension will help you to make rtl and ltr layout support the extension have these types :
GridLength
LayoutOption
TextAlignment
Int
String
ResourceKey
Thickness
EX: if you want to make you label HorizontalOptions rtl when language is arabic and ltr when its english you do it :
HorizontalOptions="{UIExtensions:UIDirection Type=LayoutOption, LTR=Start, RTL=End}"
https://gist.github.com/ads90/ff5c69410d2654dcad3ed8d275d7ca20

Related

Can StackLayout in Xamarin.Forms use "weight" like Linearlayout of Android?

I'd like use BoxView to present timelines, and each color of the lines represents a kind of task.
I have used Grid to do this. However, you know, minute is a small unit so that there are hundreds of rows in one page. That leads to a performance problem.
With Xamarin.Android, I can use Linearlayout, set height "0dp" and set weight attribute a suitable value to do this.
Well, can StackLayout do so? If not, which other layout should I use.
effect drawing

How to change height of Angular-maaterial components?

I am trying to reduce the size of material toolbar but when i try to reduce the size my title gets hidden inside the toolbar , And when i try to override mat-toolbar-row class it is not injected[Sorry for $ it wasn't actually present]
I guess there is no ways to change component height as well as other non teeming related properties.
material2 implements components from the material design specification, which consists of strict guidelines for each component.
The only things that are allowed to be changed is colors scheme.

How do you create a drop shadow in Xamarin Forms

How do you create a drop shadow on a button or label using Xamarin Forms. I am currently using Xamarin Forms 1.3 and trying to do this in XAML if possible. Does anyone have a working example they can point me to.
I have not tried this but you could create 2 instances of the same control and put them both inside a grid so that they lay directly over each other. Then with the first control (underneath) change the opacity to 0.2 so that it is very faint, then give it a small top and left margin so it sits slightly offset from the version above it. This should result in a drop-shadow type of effect.
A much better (but more involved) way of doing this is to subclass the controls you want to add the effect to and then create custom renderers to add the effect for each platform using native code

Is it possible to change the black colour of CKEditor Toolbar icons(in the moono skin), like one can with webfonts.?

I have just upgraded to CKEditor 4.4.5 from 3.5, and notice quite a few changes !! One of the changes is the new skin called Moono which looks great. However it did get me wondering whether it would be possible to change the black in the menu icons to a custom colour, for branding reasons for example. We do this in the rest of the web application using a combination of Server code and CSS.
Many thanks.
Toolbar icons in Moono are images, so if you want to change them, you'd need to create a new skin or use an alternative one from the CKEditor Addons Repository.
However, since Moono is a monochromatic skin, maybe for branding purposes it would be enough for you to use the so-called "chameleon feature" that lets you change the UI color with a simple configuration option?
If so, just use config.uiColor to provide a mataching RGB color value or an HTML color name, as in:
config.uiColor = '#AADC6E';
See a working example here: http://sdk.ckeditor.com/samples/uicolor.html

how to set width,height of telerik RAD Calendar

In my asp.net web site project I want to make rad calendar control smaller programmatically that get rendered by default to the browser(which is quite big for my requirement).I tried setting height and width of the control it doesn't work.How can I fix this?
RadCalendar calendar = new RadCalendar();
calendar.Width = x;
calendar.Height = y;
Panel1.Controls.Add(calendar);
Each of the Telerik Skins actually have a minimum height and width setting for the RadCalendar in order to ensure that the visual styles of the control are not broken. As you can imagine modifying the width and height to arbitrary settings could skew the look and feel of the control quite a bit. What you can do, however, is either modify one of the existing skins or create your own. This section in their online documentation covers how to change the appearance, and the specific article covers how to create a custom skin.

Resources