本文整理汇总了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);
}
}
}
}
示例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;
}
示例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;
}
示例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 ();
}
示例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;
}
示例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);
}