.NET-3.Xamarin3.学习与总结


前言

记录学习过程中的值得记录的问题与小知识。

//ScrollView
//ScrollX和ScrollY当前滚动量还
//提供内容总量ContentSize。
//滚动结束事件Scrolled,

一、字体的更换

有两种方式。
第一种官网字体

[assembly: ExportFont("FZSTK.TTF", Alias = "FZSTK")] 
[assembly: ExportFont("SIMYOU.TTF", Alias = "SIMYOU")] 
[assembly: ExportFont("STXINGKA.TTF", Alias = "STXINGKA")] 
[assembly: ExportFont("SIMHEI.TTF", Alias = "simhei")]
[assembly: ExportFont("Lobster-Regular.ttf", Alias = "Lobster")] 
//第二种
<ContentPage.Resources>
    <ResourceDictionary>
        <OnPlatform x:TypeArguments="x:String" x:Key="aaa">
          <On Platform="Android" Value="Lobster-Regular.ttf#"/>
          <On Platform="iOS" Value="Lobster-Regular"/>     
       	 <On Platform="UWP" Value="/Assets/Lobster-Regular.ttf#" />
        </OnPlatform>                   
    </ResourceDictionary>
</ContentPage.Resources>

<Label Text="Welcome toamari 天赐良机 Forms! " FontFamily="{StaticResource aaa}" />

二、Xamarin listview更改颜色

var lastCell ;
private void ViewCell_Tapped(object sender, EventArgs e)
{
    if (lastCell != null)
        lastCell.View.BackgroundColor = Color.Red;//默认颜色
    var viewCell = (ViewCell)sender;
    if (viewCell.View != null)
    {
        viewCell.View.BackgroundColor = Color.Green;//点击后颜色
        lastCell = viewCell;
    }
}

三、ListView 上下文操作

posted @   cactus9  阅读(18)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
点击右上角即可分享
微信分享提示