@Retention(value=RUNTIME)
public @interface LayoutSpec
A class that is annotated with LayoutSpec must implement a method with the
OnCreateLayout annotation. It may also implement methods with the following annotations:
- OnLoadStyle
- OnEvent
If you wish to create a component that mounts its own content, then use MountSpec
instead.
For example:
@LayoutSpec
public class MyComponentSpec {
@OnCreateLayout
ComponentLayout onCreateLayout(LayoutContext c, @Prop MyProp prop) {
return Row.create(c)
.alignItems(FLEX_START)
.child(someChild1)
.child(someChild2)
.build();
}
}
| Modifier and Type | Optional Element and Description |
|---|---|
java.lang.Class<?>[] |
events |
boolean |
isPublic |
boolean |
isPureRender |
java.lang.Class<?>[] |
triggers |
java.lang.String |
value |
public abstract boolean isPublic
public abstract boolean isPureRender