다음을 통해 공유


IFontScaleConverter.ForScale(Single) Method

Definition

Finds a matching FontScaleConverter for the given fontScale factor.

[Android.Runtime.Register("forScale", "(F)Landroid/content/res/FontScaleConverter;", "", ApiSince=35)]
public static Android.Content.Res.IFontScaleConverter? ForScale (float fontScale);
[<Android.Runtime.Register("forScale", "(F)Landroid/content/res/FontScaleConverter;", "", ApiSince=35)>]
static member ForScale : single -> Android.Content.Res.IFontScaleConverter

Parameters

fontScale
Single

the scale factor, usually from Configuration#fontScale.

Returns

a converter for the given scale, or null if non-linear scaling should not be used.

Attributes

Remarks

Finds a matching FontScaleConverter for the given fontScale factor.

Generally you shouldn't need this; you can use android.util.TypedValue#applyDimension(int, float, DisplayMetrics) directly and it will do the scaling conversion for you. Dimens and resources loaded from XML will also be automatically converted. But for UI frameworks or other situations where you need to do the conversion without an Android Context, you can use this method.

Java documentation for android.content.res.FontScaleConverter.forScale(float).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to