您的位置:首页 > 其它

《Microsoft_Press_eBook_Xamarin_Preview_2_PDF》中文摘要(持续更新中)

2015-06-26 11:09 429 查看
内容来自谷歌翻译+个人理解,因联系不上原作者,完全翻译有可能涉及版权,所以摘录一些精要。

方便自己和他人交流参考学习,期待大家一块翻译剩下的(排版没来得及折腾,见谅)。

环境:破解版Xamarin for Visual Studio 3.9.547,点我查看下载地址

(备注:只有windows版本,没有相应mac破解,不过对于学习来说足够了)

1.水平和垂直对其默认属性不是左对齐,而是默认填满。The default value of HorizontalOptions and VerticalOptions is not LayoutOptions.Start,
as the default appearance of the text might suggest. The default value is instead LayoutOptions.Fill.
2.设置color.transparent意味着默认值,安卓下黑色,ios白色。但是设置其他颜色的时候要慎重,因为有可能设置的颜色属性,每个系统对于同样颜色解析出来不同。But don’t try to just ignore all the platform defaults and explicitly set all the colors in your application to your own color scheme. This probably won’t work as well as you hope because many views use
other colors that relate to the color theme of the operating system but that are not exposed through
Xamarin.Forms properties.
3.关于设置fontfamily,是个麻烦事,因为有些字体某些平台木有。The hardest of these to use is FontFamily. In theory you can set it to a font family name such as
“Times Roman,” but it will work only if that particular font family is supported on the particular platform. For this reason, you’ll probably use FontFamily in connection with Device.OnPlatform, and
you’ll need to know each platform’s supported font family names. For this reason, a demonstration of
FontFamily must await a future chapter.
4.formattedtext是格式化的text。可以自定义每一段字体的样式,eg:
var myFormattedString=new FormattedString();
var sp= new Span {Text = "aaa" , ForegroundColor = Color .Green};
var sp1 = new Span { Text = "bbb", ForegroundColor = Color.Red };

new Label
{
FormattedText =   myFormattedString,
//                        Text = "Greetings, Xamarin.Forms!",
XAlign = TextAlignment .Center,
YAlign = TextAlignment .Center,
}
5.Text = "cc\u2019aaa\u2003ddddd"//cc'aaa dddd
6.默认的字体大小不是像素而是单位。These are not pixel sizes! As with the height of the iOS status bar, it’s best to refer to these sizes only
vaguely as some kind of “units.”


chapter 3 细说文本
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: