本文整理汇总了C#中IAttributeSet.GetAttributeResourceValue方法的典型用法代码示例。如果您正苦于以下问题:C# IAttributeSet.GetAttributeResourceValue方法的具体用法?C# IAttributeSet.GetAttributeResourceValue怎么用?C# IAttributeSet.GetAttributeResourceValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAttributeSet
的用法示例。
在下文中一共展示了IAttributeSet.GetAttributeResourceValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
private void Initialize(IAttributeSet attrs)
{
TypedArray a = Context.ObtainStyledAttributes(attrs, Resource.Styleable.TextWithHelp);
string helpText = a.GetString(Resource.Styleable.TextWithHelp_help_text);
const string xmlns = "http://schemas.android.com/apk/res/android";
string text = Context.GetString(attrs.GetAttributeResourceValue(xmlns, "text", Resource.String.ellipsis));
Initialize(text, helpText);
}
示例2: 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;
}
示例3: HelpButton
public HelpButton(Context context, IAttributeSet attrs) : base(context, attrs)
{
SetGravity(GravityFlags.Center);
img = new ImageView(context);
img.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
int sourceResourceId = attrs.GetAttributeResourceValue("http://schemas.android.com/apk/res/android", "src", 0);
img.SetImageResource(sourceResourceId);
Click += (sender, args) =>
{
if (HelpClickListener != null)
{
HelpClickListener(isHelp);
}
};
AddView(img);
}
示例4: ProcessAttributeSets
void ProcessAttributeSets(IAttributeSet attrs)
{
var resID = attrs.GetAttributeResourceValue (null, "description", -1);
var val = resID == -1 ?
attrs.GetAttributeValue (null, "description")
: Context.Resources.GetString (resID);
desc = (val ?? string.Empty).ToUpper ();
}