本文整理汇总了C#中Android.Widget.TextView.SetAllCaps方法的典型用法代码示例。如果您正苦于以下问题:C# TextView.SetAllCaps方法的具体用法?C# TextView.SetAllCaps怎么用?C# TextView.SetAllCaps使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Android.Widget.TextView
的用法示例。
在下文中一共展示了TextView.SetAllCaps方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateDefaultTabView
private TextView CreateDefaultTabView(Android.Content.Context context)
{
TextView textView = new TextView(context);
textView.LayoutParameters = new LinearLayout.LayoutParams (0, ViewGroup.LayoutParams.WrapContent, 1f);
textView.Gravity = GravityFlags.Center;
textView.SetTextSize(ComplexUnitType.Sp, TAB_VIEW_TEXT_SIZE_SP);
textView.Typeface = Android.Graphics.Typeface.DefaultBold;
if (Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Honeycomb)
{
TypedValue outValue = new TypedValue();
Context.Theme.ResolveAttribute(Android.Resource.Attribute.SelectableItemBackground, outValue, false);
textView.SetBackgroundResource(outValue.ResourceId);
}
if (Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.IceCreamSandwich)
{
textView.SetAllCaps(true);
}
int padding = (int)(TAB_VIEW_PADDING_DIPS * Resources.DisplayMetrics.Density);
textView.SetPadding(padding, padding, padding, padding);
return textView;
}
示例2: MakeHeaderView
TextView MakeHeaderView ()
{
var result = new TextView (context) {
Gravity = GravityFlags.Center,
TextSize = 10,
};
result.SetPadding (4, 4, 4, 4);
result.SetBackgroundColor (Color.Rgb (0x22, 0x22, 0x22));
result.SetAllCaps (true);
result.SetTypeface (Typeface.DefaultBold, TypefaceStyle.Bold);
result.SetTextColor (Color.White);
return result;
}
示例3: CreateDefaultTabView
private TextView CreateDefaultTabView(Context context)
{
var textView = new TextView(context);
textView.Gravity = GravityFlags.Center;
textView.SetTextSize(ComplexUnitType.Sp, TabViewTextSizeSp);
textView.Typeface = Typeface.DefaultBold;
if (Build.VERSION.SdkInt >= BuildVersionCodes.Honeycomb)
{
var outValue = new TypedValue();
Context.Theme.ResolveAttribute(Resource.Attribute.SelectableItemBackground, outValue, false);
textView.SetBackgroundResource(outValue.ResourceId);
}
if (Build.VERSION.SdkInt >= BuildVersionCodes.IceCreamSandwich)
{
textView.SetAllCaps(true);
}
var padding = (int) (TabViewPaddingDips*Resources.DisplayMetrics.Density);
textView.SetPadding(padding, padding, padding, padding);
return textView;
}
示例4: CreateDefaultTabView
/**
* Create a default view to be used for tabs. This is called if a custom tab view is not set via
* {@link #setCustomTabView(int, int)}.
*/
protected TextView CreateDefaultTabView(Context context) {
TextView textView = new TextView(context);
textView.Gravity = Android.Views.GravityFlags.Center;
textView.SetTextSize(ComplexUnitType.Sp, 12);
textView.Typeface = Typeface.DefaultBold;
if (Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Honeycomb) {
// If we're running on Honeycomb or newer, then we can use the Theme's
// selectableItemBackground to ensure that the View has a pressed state
TypedValue outValue = new TypedValue();
Context.Theme.ResolveAttribute(Android.Resource.Attribute.SelectableItemBackground,outValue, true);
textView.SetBackgroundResource(outValue.ResourceId);
}
if ((int)Build.VERSION.SdkInt >= 14 || (int)Build.VERSION.SdkInt <= 15){
// If we're running on ICS or newer, enable all-caps to match the Action Bar tab style
textView.SetAllCaps(true);
}
int padding = (int) (16 * Resources.DisplayMetrics.Density);
textView.SetPadding(padding, padding, padding, padding);
return textView;
}
示例5: CreateDefaultTabView
protected TextView CreateDefaultTabView(Context context)
{
TextView textView = new TextView(context);
textView.Gravity = GravityFlags.Center;
textView.SetTextSize(ComplexUnitType.Sp, TAB_VIEW_TEXT_SIZE_SP);
textView.Typeface = Typeface.DefaultBold;
if (Build.VERSION.SdkInt >= Build.VERSION_CODES.Honeycomb)
{
TypedValue outValue = new TypedValue();
Context.Theme.ResolveAttribute(Android.Resource.Attribute.SelectableItemBackground,
outValue, true);
textView.SetBackgroundResource(outValue.ResourceId);
}
if (Build.VERSION.SdkInt >= Build.VERSION_CODES.IceCreamSandwich)
{
textView.SetAllCaps(true);
}
int padding = (int)(TAB_VIEW_PADDING_DIPS * Resources.DisplayMetrics.Density);
textView.SetPadding(padding, padding, padding, padding);
return textView;
}