当前位置: 首页>>代码示例>>C#>>正文


C# IAttributeSet.GetAttributeIntValue方法代码示例

本文整理汇总了C#中IAttributeSet.GetAttributeIntValue方法的典型用法代码示例。如果您正苦于以下问题:C# IAttributeSet.GetAttributeIntValue方法的具体用法?C# IAttributeSet.GetAttributeIntValue怎么用?C# IAttributeSet.GetAttributeIntValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IAttributeSet的用法示例。


在下文中一共展示了IAttributeSet.GetAttributeIntValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MapViewLayoutParams

 public MapViewLayoutParams(Context context, IAttributeSet attrs)
     : base(context, attrs)
 {
     this.X = attrs.GetAttributeIntValue("http://schemas.mapquest.com/apk/res/mapquest", "x", int.MaxValue);
     this.Y = attrs.GetAttributeIntValue("http://schemas.mapquest.com/apk/res/mapquest", "x", int.MaxValue);
     String geoPoint = attrs.GetAttributeValue("http://schemas.mapquest.com/apk/res/mapquest", "geoPoint");
     if ((geoPoint.Length > 0))
     {
         String[] arr = geoPoint.Split(new[] { "," }, StringSplitOptions.None);
         if (arr.Length > 1)
         {
             try
             {
                 double latitude = Double.Parse(arr[0].Trim());
                 double longitude = Double.Parse(arr[1].Trim());
                 this.Point = new GeoPoint(latitude, longitude);
                 this.Mode = 0;
             }
             catch (NumberFormatException nfe)
             {
                 Log.Error("mq.android.maps.mapview", "Invalid value for geoPoint attribute : " + geoPoint);
             }
         }
     }
 }
开发者ID:knji,项目名称:mvvmcross.plugins,代码行数:25,代码来源:MapView.cs

示例2: BindableViewPager

        public BindableViewPager(Context context, IAttributeSet attrs, MvxBindablePagerAdapter adapter)
            : base(context, attrs)
        {
            this._initialIndex = attrs.GetAttributeIntValue("http://schemas.android.com/apk/res-auto", "selectedIndex", -1);
            this.OffscreenPageLimit = attrs.GetAttributeIntValue("http://schemas.android.com/apk/res-auto", "offscreenPageLimit", 1);

            var itemTemplateId = MvxAttributeHelpers.ReadListItemTemplateId(context, attrs);
            adapter.ItemTemplateId = itemTemplateId;
            Adapter = adapter;
        }
开发者ID:ExRam,项目名称:Cheesebaron.MvvmCross.Bindings,代码行数:10,代码来源:BindableViewPager.cs

示例3: SeekBarPreference

        public SeekBarPreference(Context context, IAttributeSet attrs)
            : base(context, attrs)
        {
            _progress = 0;
            _minimumValue = attrs.GetAttributeIntValue(_applicationNamespace, "minValue", 0);
            _defaultValue = attrs.GetAttributeIntValue(_applicationNamespace, "defaultValue", 0) - _minimumValue;
            _maximumValue = attrs.GetAttributeIntValue(_applicationNamespace, "maxValue", 100) - _minimumValue;

            int suffixResourceId = attrs.GetAttributeResourceValue(_applicationNamespace, "suffix", 0);

            if (suffixResourceId > 0)
                _suffix = " " + context.Resources.GetString(suffixResourceId);

            DialogLayoutResource = Resource.Layout.TimeoutDialogPreference;
        }
开发者ID:jorik041,项目名称:CSharpToGo,代码行数:15,代码来源:SeekBarPreference.cs

示例4: ApplyCustomFont

        //applies font from XML
        public static void ApplyCustomFont(TextView view, Context context, IAttributeSet attrs)
        {
            TypedArray attributeArray = context.ObtainStyledAttributes (attrs, Resource.Styleable.CustomFont);

            string fontName = attributeArray.GetString (Resource.Styleable.CustomFont_font);
            int textStyle = attrs.GetAttributeIntValue (ANDROID_SCHEMA, "textStyle", 0);

            Typeface customFont = SelectTypeface (context, fontName);

            switch (textStyle) {
            case 1:
                view.SetTypeface (customFont, TypefaceStyle.Bold);
                break;
            case 2:
                view.SetTypeface (customFont, TypefaceStyle.Italic);
                break;
            case 3:
                view.SetTypeface (customFont, TypefaceStyle.BoldItalic);
                break;
            default:
                view.SetTypeface (customFont, TypefaceStyle.Normal);
                break;
            }

            attributeArray.Recycle ();
        }
开发者ID:FrederickEskens,项目名称:Totem,代码行数:27,代码来源:CustomFontHelper.cs

示例5: OnCreateView

		public View OnCreateView(string name, Context context, IAttributeSet attrs)
		{
			var attributeValue = attrs.GetAttributeIntValue("http://schemas.android.com/apk/res-auto", "typeface", -1);

			if (attributeValue == -1)
				return null;

			try
			{
				var view = CreateView(name, context, attrs);
				if (view == null)
					return null;

				var font = this.ObtainTypeface(context, attributeValue);
				view.SetTypeface(font, m_Style);
				return view;

			}
			catch (Exception)
			{
			}

			return null;
		}
开发者ID:borain89vn,项目名称:demo2,代码行数:24,代码来源:TextFactoryManager.cs

示例6: SetValuesFromXml

        private void SetValuesFromXml(IAttributeSet attrs)
        {
            maxValue = attrs.GetAttributeIntValue (ANDROIDNS, "max", 100);
            minValue = attrs.GetAttributeIntValue (APPLICATIONNS, "min", 0);

            unitsLeft = GetAttributeStringValue (attrs, APPLICATIONNS, "unitsLeft", "");
            var units = GetAttributeStringValue (attrs, APPLICATIONNS, "units", "");
            unitsRight = GetAttributeStringValue (attrs, APPLICATIONNS, "unitsRight", units);

            var newInterval = attrs.GetAttributeValue (APPLICATIONNS, "interval");
            if (newInterval != null)
                int.TryParse (newInterval, out interval);
        }
开发者ID:JeffreyLau,项目名称:FiredTVLauncher,代码行数:13,代码来源:SeekBarPreference.cs


注:本文中的IAttributeSet.GetAttributeIntValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。