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


C# TextView.SetAllCaps方法代码示例

本文整理汇总了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;
		}
开发者ID:kktanpiya,项目名称:kimuraHazuki048,代码行数:25,代码来源:SlidingTabScrollView.cs

示例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;
			}
开发者ID:adamgoodrich,项目名称:Moyeu,代码行数:14,代码来源:RentalFragment.cs

示例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;
        }
开发者ID:BenjaminSheffield,项目名称:AndroidFragranceApp,代码行数:24,代码来源:SlidingTabScrollView.cs

示例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;
		}
开发者ID:jeedey93,项目名称:xamarin-android-samples,代码行数:28,代码来源:SlidingTabLayout.cs

示例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;
        }
开发者ID:meirongIn83,项目名称:SlideDatetimePickerCSharp,代码行数:24,代码来源:SlidingTabLayout.cs


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