Xamarin 练习中与AS不一样的地方

1.自定义控件的时候,继承父View的三个方法,写法不一样:

public class ObservableScrollView : ScrollView
    {
        private OnOberservableScrollViewListener mlistener;
        public ObservableScrollView(Context ct) : base(ct) { }
        public ObservableScrollView(Context context, IAttributeSet attributeSet) : base(context, attributeSet) { }
        public ObservableScrollView(Context context, IAttributeSet attributeSet, int defaultStyle) : base(context, attributeSet, defaultStyle) { }
        }

2.使用自定义View的时候。AS中是包名/类名
Xamarin.Android 中是项目名/文件(可略)/类名
如图

3.使用include 来引用一个标签还是可以用的

 <include layout="@layout/include_header_itl" />

4.改变Activity的Theme

  • 方法一:Theme = “@android:style/Theme.NoTitleBar.Fullscreen”

  • 方法二:

this.SetTheme(Android.Resource.Style.ThemeNoTitleBarFullScreen);//全屏并且无标题栏,必须在OnCreate前面设置。 
//this.Window.SetFlags(WindowManagerFlags.Fullscreen, WindowManagerFlags.Fullscreen);//只设置本页全屏
//this.RequestWindowFeature(WindowFeatures.NoTitle);//只设置无标题栏
  • 方法三:在application结点中修改:
android:theme="@android:style/Theme.NoTitleBar"
Theme.Light.NotitleBar
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

5.动画监听
animator.AnimationEnd += Animator_AnimationEnd;

   private void Animator_AnimationEnd(object sender, EventArgs e)
        {
            //TODO...
        }
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值