API~12
模型结构
- 组件使用CommonMethod流程:
TextInterface
/**
* Defines Text Component.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
* @form
*/
declare const Text: TextInterface;
TextAttribute
/**
* Provides an interface for writing texts.
*
* @interface TextInterface
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
* @form
*/
interface TextInterface {
/**
* Called when writing text.
*
* @param { string | Resource } content
* @returns { TextAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
* @form
*/
(content?: string | Resource): TextAttribute;
}
declare class TextAttribute extends CommonMethod<TextAttribute>
/**
* @extends CommonMethod
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
* @form
*/
declare class TextAttribute extends CommonMethod<TextAttribute> {
。。。。
CommonMethod通用参考
width(value: Length): T;
height(value: Length): T;
drawModifier(modifier: DrawModifier | undefined): T;
expandSafeArea(types?: Array<SafeAreaType>, edges?: Array<SafeAreaEdge>): T;
responseRegion(value: Array<Rectangle> | Rectangle): T;
mouseResponseRegion(value: Array<Rectangle> | Rectangle): T;
size(value: SizeOptions): T;
constraintSize(value: ConstraintSizeOptions): T;
touchable(value: boolean): T;
hitTestBehavior(value: HitTestMode): T;
onChildTouchTest(event: (value: Array<TouchTestInfo>) => TouchResult): T;
layoutWeight(value: number | string): T;
padding(value: Padding | Length): T;
margin(value: Margin | Length): T;
background(builder: CustomBuilder, options?: {
align?: Alignment;
}): T;
backgroundColor(value: ResourceColor): T;
pixelRound(value: PixelRoundPolicy): T;
backgroundImage(src: ResourceStr | PixelMap, repeat?: ImageRepeat): T;
backgroundImageSize(value: SizeOptions | ImageSize): T;
backgroundImagePosition(value: Position | Alignment): T;
backgroundBlurStyle(value: BlurStyle, options?: BackgroundBlurStyleOptions): T;
backgroundEffect(options: BackgroundEffectOptions): T;
backgroundImageResizable(value: ResizableOptions): T;
foregroundBlurStyle(value: BlurStyle, options?: ForegroundBlurStyleOptions): T;
opacity(value: number | Resource): T;
border(value: BorderOptions): T;
borderStyle(value: BorderStyle | EdgeStyles): T;
borderWidth(value: Length | EdgeWidths): T;
borderColor(value: ResourceColor | EdgeColors): T;
borderRadius(value: Length | BorderRadiuses): T;
borderImage(value: BorderImageOption): T;
outline(value: OutlineOptions): T;
outlineStyle(value: OutlineStyle | EdgeOutlineStyles): T;
outlineWidth(value: Dimension | EdgeOutlineWidths): T;
outlineColor(value: ResourceColor | EdgeColors): T;
outlineRadius(value: Dimension | OutlineRadiuses): T;
foregroundColor(value: ResourceColor | ColoringStrategy): T;
onClick(event: (event: ClickEvent) => void): T;
onHover(event: (isHover: boolean, event: HoverEvent) => void): T;
hoverEffect(value: HoverEffect): T;
onMouse(event: (event: MouseEvent) => void): T;
onTouch(event: (event: TouchEvent) => void): T;
onKeyEvent(event: (event: KeyEvent) => void): T;
onKeyPreIme(event: Callback<KeyEvent, boolean>): T;
focusable(value: boolean): T;
onFocus(event: () => void): T;
onBlur(event: () => void): T;
tabIndex(index: number): T;
defaultFocus(value: boolean): T;
groupDefaultFocus(value: boolean): T;
focusOnTouch(value: boolean): T;
animation(value: AnimateParam): T;
transition(value: TransitionOptions | TransitionEffect): T;
gesture(gesture: GestureType, mask?: GestureMask): T;
priorityGesture(gesture: GestureType, mask?: GestureMask): T;
parallelGesture(gesture: GestureType, mask?: GestureMask): T;
blur(value: number, options?: BlurOptions): T;
linearGradientBlur(value: number, options: LinearGradientBlurOptions): T;
motionBlur(value: MotionBlurOptions): T;
brightness(value: number): T;
contrast(value: number): T;
grayscale(value: number): T;
colorBlend(value: Color | string | Resource): T;
saturate(value: number): T;
sepia(value: number): T;
invert(value: number | InvertOptions): T;
systemBarEffect(): T;
hueRotate(value: number | string): T;
useShadowBatching(value: boolean): T;
useEffect(value: boolean): T;
backdropBlur(value: number, options?: BlurOptions): T;
renderGroup(value: boolean): T;
freeze(value: boolean): T;
translate(value: TranslateOptions): T;
scale(value: ScaleOptions): T;
gridSpan(value: number): T;
gridOffset(value: number): T;
rotate(value: RotateOptions): T;
transform(value: object): T;
onAppear(event: () => void): T;
onDisAppear(event: () => void): T;
onAttach(callback: Callback<void>): T;
onDetach(callback: Callback<void>): T;
....
了解一下即可,后续根据界面交互会一一用到,能背下来就更好了