source stringlengths 14 113 | code stringlengths 10 21.3k |
|---|---|
application-dev\ui\arkts-layout-development-create-arclist.md | // xxx.ets
import { ArcList, ArcListItem, ArcListAttribute, ArcListItemAttribute, LengthMetrics } from "@kit.ArkUI";
@Entry
@Component
struct ArcListExample {
build() {
ArcList({ initialIndex: 2 }) {
ArcListItem() {
Row() {
Image($r("app.media.wlan")).width("99px").height("99px")
... |
application-dev\ui\arkts-layout-development-create-arclist.md | // xxx.ets
import { ArcList, ArcListAttribute, ArcListItemAttribute, ArcListItem, LengthMetrics } from '@kit.ArkUI';
import { util } from '@kit.ArkTS';
class Contact {
key: string = util.generateRandomUUID(true);
name: string;
icon: Resource;
constructor(name: string, icon: Resource) {
this.name = name;
... |
application-dev\ui\arkts-layout-development-create-arclist.md | @Builder
function customHeader() {
Column() {
Text("Settings")
.fontColor("#FFFFFFFF")
.fontSize('19fp')
}
} |
application-dev\ui\arkts-layout-development-create-arclist.md | context: UIContext = this.getUIContext();
arcListHeader: ComponentContent<Object> = new ComponentContent(this.context, wrapBuilder(customHeader)); |
application-dev\ui\arkts-layout-development-create-arclist.md | ArcList({header: this.arcListHeader}) {
ArcListItem() {
// ...
}
ArcListItem() {
// ...
}
// ...
} |
application-dev\ui\arkts-layout-development-create-arclist.md | ArcList() {
// ...
}
.space(LengthMetrics.px(30)) |
application-dev\ui\arkts-layout-development-create-arclist.md | ArcListItem() {
// ...
}
.autoScale(false) |
application-dev\ui\arkts-layout-development-create-arclist.md | ArcList() {
// ...
}
.scrollBar(BarState.Auto)
.scrollBarWidth(LengthMetrics.px(10))
.scrollBarColor(ColorMetrics.resourceColor(Color.White)) |
application-dev\ui\arkts-layout-development-create-arclist.md | private arcListScroller: Scroller = new Scroller(); |
application-dev\ui\arkts-layout-development-create-arclist.md | // Use arcListScroller to initialize the scroller parameter to bind it with the ArcList component.
ArcList({ scroller: this.arcListScroller }) {
// ...
} |
application-dev\ui\arkts-layout-development-create-arclist.md | // Use arcListScroller to initialize the scroller parameter to bind it with the ArcScrollBar component.
ArcScrollBar({ scroller: this.arcListScroller }) |
application-dev\ui\arkts-layout-development-create-arclist.md | const alphabets = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
@Entry
@Component
struct ContactsArcList {
// Index of the selected item in the index bar
@State selectedIndex: number = 0;
// Scroll controller bound to the... |
application-dev\ui\arkts-layout-development-create-arclist.md | @Builder
itemEnd(item: Contact) {
// Build the component that appears from the end edge when the list item is swiped left.
Button({ type: ButtonType.Circle }) {
Image($r('app.media.ic_public_delete_filled'))
.width(20)
.height(20)
}
.backgroundColor(Color.Black)
.on... |
application-dev\ui\arkts-layout-development-create-arclist.md | // When constructing an ArcList component, use ForEach to render list items based on the data source this.contacts.
ArcListItem() {
// ...
}
.swipeAction({
end: {
// item is the data corresponding to this list item in the data source this.contacts.
builder: () => { this.itemEnd(item) }
... |
application-dev\ui\arkts-layout-development-create-arclist.md | ArcList() {
// ...
}.cachedCount(3) |
application-dev\ui\arkts-layout-development-create-arclist.md | ArcList() {
// ...
}
// Enable focus for the ArcList component.
.focusable(true)
// Allow the ArcList component to gain focus on touch.
.focusOnTouch(true)
// Set the ArcList component as the default focus on the page.
.defaultFocus(true) |
application-dev\ui\arkts-layout-development-create-arclist.md | ArcList() {
// ...
}
.digitalCrownSensitivity(CrownSensitivity.MEDIUM) |
application-dev\ui\arkts-layout-development-create-grid.md | Grid() {
// ...
}
.rowsTemplate('1fr 1fr 1fr')
.columnsTemplate('1fr 2fr 1fr') |
application-dev\ui\arkts-layout-development-create-grid.md | layoutOptions: GridLayoutOptions = {
regularSize: [1, 1],
onGetRectByIndex: (index: number) => {
if (index = = key1) { // key1 is the index of the 0 key.
return [6, 0, 1, 2];
} else if (index == key2) { // key2 is the index of the = key.
return [5, 3, 2, 1];
}
// ...
// Here, you nee... |
application-dev\ui\arkts-layout-development-create-grid.md | Grid() {
// ...
}
.maxCount(3)
.layoutDirection(GridDirection.Row) |
application-dev\ui\arkts-layout-development-create-grid.md | Grid() {
GridItem() {
Text('Conference')
// ...
}
GridItem() {
Text('Sign-in')
// ...
}
GridItem() {
Text('Vote')
// ...
}
GridItem() {
Text('Print')
// ...
}
}
.rowsTemplate('1fr 1fr')
.columnsTemplate('1fr 1fr') |
application-dev\ui\arkts-layout-development-create-grid.md | @Entry
@Component
struct OfficeService {
@State services: Array<string> = ['Conference', 'Vote','Sign-in', 'Print']
build() {
Column() {
Grid() {
ForEach(this.services, (service:string) => {
GridItem() {
Text(service)
}
}, (service:string):string => service... |
application-dev\ui\arkts-layout-development-create-grid.md | Grid() {
// ...
}
.columnsGap(10)
.rowsGap(15) |
application-dev\ui\arkts-layout-development-create-grid.md | @Entry
@Component
struct Shopping {
@State services: Array<string> = ['Live', 'Premium']
build() {
Column({ space: 5 }) {
Grid() {
ForEach(this.services, (service: string, index) => {
GridItem() {
}
.width('25%')
}, (service:string):string => service)
}... |
application-dev\ui\arkts-layout-development-create-grid.md | private scroller: Scroller = new Scroller() |
application-dev\ui\arkts-layout-development-create-grid.md | Column({ space: 5 }) {
Grid(this.scroller) {
}
.columnsTemplate('1fr 1fr 1fr 1fr 1fr 1fr 1fr')
Row({space: 20}) {
Button('Previous')
.onClick(() => {
this.scroller.scrollPage({
next: false
})
})
Button('Next')
.onClick(() => {
this.scroller.scrollPag... |
application-dev\ui\arkts-layout-development-create-grid.md | private gridScroller: Scroller = new Scroller(); |
application-dev\ui\arkts-layout-development-create-grid.md | // Use gridScroller to initialize the scroller parameter to bind it with the Grid component.
Grid({ scroller: this.gridScroller }) {
// ...
} |
application-dev\ui\arkts-layout-development-create-grid.md | // Use gridScroller to initialize the scroller parameter to bind it with the ScrollBar component.
ScrollBar({ scroller: this.gridScroller }) |
application-dev\ui\arkts-layout-development-create-grid.md | Grid() {
LazyForEach(this.dataSource, () => {
GridItem() {
}
})
}
.cachedCount(3) |
application-dev\ui\arkts-layout-development-create-list.md | List() {
// ...
}
.listDirection(Axis.Horizontal) |
application-dev\ui\arkts-layout-development-create-list.md | List() {
// ...
}
.lanes(2) |
application-dev\ui\arkts-layout-development-create-list.md | @Entry
@Component
struct EgLanes {
@State egLanes: LengthConstrain = { minLength: 200, maxLength: 300 }
build() {
List() {
// ...
}
.lanes(this.egLanes)
}
} |
application-dev\ui\arkts-layout-development-create-list.md | List() {
// ...
}
.alignListItem(ListItemAlign.Center) |
application-dev\ui\arkts-layout-development-create-list.md | @Entry
@Component
struct CityList {
build() {
List() {
ListItem() {
Text('Beijing').fontSize(24)
}
ListItem() {
Text('Hangzhou').fontSize(24)
}
ListItem() {
Text('Shanghai').fontSize(24)
}
}
.backgroundColor('#FFF1F3F5')
.alignListItem(List... |
application-dev\ui\arkts-layout-development-create-list.md | List() {
ListItem() {
Row() {
Image($r('app.media.iconE'))
.width(40)
.height(40)
.margin(10)
Text('Tom')
.fontSize(20)
}
}
ListItem() {
Row() {
Image($r('app.media.iconF'))
.width(40)
.height(40)
.margin(10)
Text('Trac... |
application-dev\ui\arkts-layout-development-create-list.md | import { util } from '@kit.ArkTS'
class Contact {
key: string = util.generateRandomUUID(true);
name: string;
icon: Resource;
constructor(name: string, icon: Resource) {
this.name = name;
this.icon = icon;
}
}
@Entry
@Component
struct SimpleContacts {
private contacts: Array<object> = [
new Co... |
application-dev\ui\arkts-layout-development-create-list.md | List({ space: 10 }) {
// ...
} |
application-dev\ui\arkts-layout-development-create-list.md | class DividerTmp {
strokeWidth: Length = 1
startMargin: Length = 60
endMargin: Length = 10
color: ResourceColor = '#ffe9f0f0'
constructor(strokeWidth: Length, startMargin: Length, endMargin: Length, color: ResourceColor) {
this.strokeWidth = strokeWidth
this.startMargin = startMargin
this.endMarg... |
application-dev\ui\arkts-layout-development-create-list.md | List() {
// ...
}
.scrollBar(BarState.Auto) |
application-dev\ui\arkts-layout-development-create-list.md | @Entry
@Component
struct ContactsList {
@Builder itemHead(text: string) {
// Header of the list group, corresponding to the group A and B locations.
Text(text)
.fontSize(20)
.backgroundColor('#fff1f3f5')
.width('100%')
.padding(5)
}
build() {
List() {
ListItemGroup({ ... |
application-dev\ui\arkts-layout-development-create-list.md | import { util } from '@kit.ArkTS'
class Contact {
key: string = util.generateRandomUUID(true);
name: string;
icon: Resource;
constructor(name: string, icon: Resource) {
this.name = name;
this.icon = icon;
}
}
class ContactsGroup {
title: string = ''
contacts: Array<object> | null = null
key: st... |
application-dev\ui\arkts-layout-development-create-list.md | private listScroller: Scroller = new Scroller(); |
application-dev\ui\arkts-layout-development-create-list.md | Stack({ alignContent: Alignment.Bottom }) {
// Use listScroller to initialize the scroller parameter to bind it with the List component.
List({ space: 20, scroller: this.listScroller }) {
// ...
}
Button() {
// ...
}
.onClick(() => {
// Specify where e to jump when the specific button is clicke... |
application-dev\ui\arkts-layout-development-create-list.md | const alphabets = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
@Entry
@Component
struct ContactsList {
@State selectedIndex: number = 0;
private listScroller: Scroller = new Scroller();
build() {
Stack({ alignConten... |
application-dev\ui\arkts-layout-development-create-list.md | @Builder itemEnd(index: number) {
// Build the component that appears from the end edge when the list item is swiped left.
Button({ type: ButtonType.Circle }) {
Image($r('app.media.ic_public_delete_filled'))
.width(20)
.height(20)
}
.onClick(() => {
// this.me... |
application-dev\ui\arkts-layout-development-create-list.md | // When constructing a list, use ForEach to render list items based on the data source this.messages.
ListItem() {
// ...
}
.swipeAction({
end: {
// index is the index of the list item.
builder: () => { this.itemEnd(index) },
}
}) // Set the swipe action. |
application-dev\ui\arkts-layout-development-create-list.md | ListItem() {
Badge({
count: 1,
position: BadgePosition.RightTop,
style: { badgeSize: 16, badgeColor: '#FA2A2D' }
}) {
// The Image component implements the contact profile picture.
// ...
}
} |
application-dev\ui\arkts-layout-development-create-list.md | //ToDo.ets
import { util } from '@kit.ArkTS'
export class ToDo {
key: string = util.generateRandomUUID(true);
name: string;
constructor(name: string) {
this.name = name;
}
} |
application-dev\ui\arkts-layout-development-create-list.md | //ToDoListItem.ets
import { ToDo } from './ToDo';
@Component
export struct ToDoListItem {
@Link isEditMode: boolean
@Link selectedItems: ToDo[]
private toDoItem: ToDo = new ToDo("");
build() {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
//... |
application-dev\ui\arkts-layout-development-create-list.md | //ToDoList.ets
import { ToDo } from './ToDo';
import { ToDoListItem } from './ToDoListItem';
@Entry
@Component
struct ToDoList {
@State toDoData: ToDo[] = []
@Watch('onEditModeChange') @State isEditMode: boolean = false
@State selectedItems: ToDo[] = []
private availableThings: str... |
application-dev\ui\arkts-layout-development-create-list.md | // Structure reference
export class ToDo {
key: string = util.generateRandomUUID(true);
name: string;
toDoData: ToDo[] = [];
constructor(name: string) {
this.name = name;
}
} |
application-dev\ui\arkts-layout-development-create-list.md | // Implementation reference
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
// ...
}
.gesture(
GestureGroup(GestureMode.Exclusive,
LongPressGesture()
.onAction(() => {
if (!this.isEditMode) {
this.isEditMode = true; // Enter the ... |
application-dev\ui\arkts-layout-development-create-list.md | // Structure reference
import { util } from '@kit.ArkTS'
export class ToDo {
key: string = util.generateRandomUUID(true);
name: string;
toDoData: ToDo[] = [];
constructor(name: string) {
this.name = name;
}
} |
application-dev\ui\arkts-layout-development-create-list.md | // Implementation reference
if (this.isEditMode) {
Checkbox()
.onChange((isSelected) => {
if (isSelected) {
When this.selectedItems.push(toDoList.toDoItem) // this.selectedItems is selected, the selected list items are recorded. You can construct the list items based on the site ... |
application-dev\ui\arkts-layout-development-create-list.md | // Structure reference
import { util } from '@kit.ArkTS'
export class ToDo {
key: string = util.generateRandomUUID(true);
name: string;
toDoData: ToDo[] = [];
constructor(name: string) {
this.name = name;
}
} |
application-dev\ui\arkts-layout-development-create-list.md | // Implementation reference
Button('Delete')
.onClick(() => {
// this.toDoData is the to-do list item, which can be constructed based on service requirements. After an item is clicked, the corresponding data is removed.
let leftData = this.toDoData.filter((item) => {
return !this.sel... |
application-dev\ui\arkts-layout-development-create-list.md | List() {
// ...
}.cachedCount(3) |
application-dev\ui\arkts-layout-development-create-list.md | interface ItemInfo {
index: number,
name: string,
label: ResourceStr,
type?: string,
}
interface ItemGroupInfo extends ItemInfo {
children: ItemInfo[]
} |
application-dev\ui\arkts-layout-development-create-list.md | @State routes: ItemGroupInfo[] = [
{
index: 0,
name: 'basicInfo',
label: 'Basic personal information',
children: [
{
index: 0,
name: 'Nickname',
label: 'xxxx',
type: 'Text'
},
{
index: 1,
... |
application-dev\ui\arkts-layout-development-create-list.md | @Builder
ListItemGroupHeader(itemGroup: ItemGroupInfo) {
Row() {
Text(itemGroup.label)
Blank()
Image($r('sys.media.ohos_ic_public_arrow_down'))
.fillColor($r('sys.color.ohos_id_color_fourth'))
.height(30)
.width(30)
.rotate({ angle: !!itemGroup.c... |
application-dev\ui\arkts-layout-development-create-looping.md | Swiper() {
Text('0')
.width('90%')
.height('100%')
.backgroundColor(Color.Gray)
.textAlign(TextAlign.Center)
.fontSize(30)
Text('1')
.width('90%')
.height('100%')
.backgroundColor(Color.Green)
.textAlign(TextAlign.Center)
.fontSize(30)
Text('2')
.width('90%')
.hei... |
application-dev\ui\arkts-layout-development-create-looping.md | Swiper() {
// ...
}
.loop(false) |
application-dev\ui\arkts-layout-development-create-looping.md | Swiper() {
// ...
}
.loop(true)
.autoPlay(true)
.interval(1000) |
application-dev\ui\arkts-layout-development-create-looping.md | Swiper() {
Text('0')
.width('90%')
.height('100%')
.backgroundColor(Color.Gray)
.textAlign(TextAlign.Center)
.fontSize(30)
Text('1')
.width('90%')
.height('100%')
.backgroundColor(Color.Green)
.textAlign(TextAlign.Center)
.fontSize(30)
Text('2')
.width('90%')
.hei... |
application-dev\ui\arkts-layout-development-create-looping.md | Swiper() {
// ...
}
.indicator(
Indicator.dot()
.left(0)
.itemWidth(15)
.itemHeight(15)
.selectedItemWidth(30)
.selectedItemHeight(15)
.color(Color.Red)
.selectedColor(Color.Blue)
) |
application-dev\ui\arkts-layout-development-create-looping.md | Swiper() {
// ...
}
.displayArrow(true, false) |
application-dev\ui\arkts-layout-development-create-looping.md | Swiper() {
// ...
}
.displayArrow({
showBackground: true,
isSidebarMiddle: true,
backgroundSize: 24,
backgroundColor: Color.White,
arrowSize: 18,
arrowColor: Color.Blue
}, false) |
application-dev\ui\arkts-layout-development-create-looping.md | @Entry
@Component
struct SwiperDemo {
private swiperBackgroundColors: Color[] = [Color.Blue, Color.Brown, Color.Gray, Color.Green, Color.Orange,
Color.Pink, Color.Red, Color.Yellow];
private swiperAnimationMode: (SwiperAnimationMode | boolean | undefined)[] = [undefined, true, false,
SwiperAnimationMode.NO_... |
application-dev\ui\arkts-layout-development-create-looping.md | Swiper() {
// ...
}
.indicator(true)
.vertical(false) |
application-dev\ui\arkts-layout-development-create-looping.md | Swiper() {
// ...
}
.indicator(true)
.vertical(true) |
application-dev\ui\arkts-layout-development-create-looping.md | Swiper() {
Text('0')
.width(250)
.height(250)
.backgroundColor(Color.Gray)
.textAlign(TextAlign.Center)
.fontSize(30)
Text('1')
.width(250)
.height(250)
.backgroundColor(Color.Green)
.textAlign(TextAlign.Center)
.fontSize(30)
Text('2')
.width(250)
.height(250)
.... |
application-dev\ui\arkts-layout-development-create-looping.md | @Entry
@Component
struct SwiperCustomAnimationExample {
private DISPLAY_COUNT: number = 2
private MIN_SCALE: number = 0.75
@State backgroundColors: Color[] = [Color.Green, Color.Blue, Color.Yellow, Color.Pink, Color.Gray, Color.Orange]
@State opacityList: number[] = []
@State scaleList: number[] = []
@Stat... |
application-dev\ui\arkts-layout-development-flex-layout.md | Flex({ direction: FlexDirection.Row }) {
Text('1').width('33%').height(50).backgroundColor(0xF5DEB3)
Text('2').width('33%').height(50).backgroundColor(0xD2B48C)
Text('3').width('33%').height(50).backgroundColor(0xF5DEB3)
}
.height(70)
.width('90%')
.padding(10)
.backgroundColor(0xAFEEEE) |
application-dev\ui\arkts-layout-development-flex-layout.md | Flex({ direction: FlexDirection.RowReverse }) {
Text('1').width('33%').height(50).backgroundColor(0xF5DEB3)
Text('2').width('33%').height(50).backgroundColor(0xD2B48C)
Text('3').width('33%').height(50).backgroundColor(0xF5DEB3)
}
.height(70)
.width('90%')
.padding(10)
.backgroundColor(0xAFEEEE) |
application-dev\ui\arkts-layout-development-flex-layout.md | Flex({ direction: FlexDirection.Column }) {
Text('1').width('100%').height(50).backgroundColor(0xF5DEB3)
Text('2').width('100%').height(50).backgroundColor(0xD2B48C)
Text('3').width('100%').height(50).backgroundColor(0xF5DEB3)
}
.height(70)
.width('90%')
.padding(10)
.backgroundColor(0xAFEEEE) |
application-dev\ui\arkts-layout-development-flex-layout.md | Flex({ direction: FlexDirection.ColumnReverse }) {
Text('1').width('100%').height(50).backgroundColor(0xF5DEB3)
Text('2').width('100%').height(50).backgroundColor(0xD2B48C)
Text('3').width('100%').height(50).backgroundColor(0xF5DEB3)
}
.height(70)
.width('90%')
.padding(10)
.backgroundColor(0xAFEE... |
application-dev\ui\arkts-layout-development-flex-layout.md | Flex({ wrap: FlexWrap.NoWrap }) {
Text('1').width('50%').height(50).backgroundColor(0xF5DEB3)
Text('2').width('50%').height(50).backgroundColor(0xD2B48C)
Text('3').width('50%').height(50).backgroundColor(0xF5DEB3)
}
.width('90%')
.padding(10)
.backgroundColor(0xAFEEEE) |
application-dev\ui\arkts-layout-development-flex-layout.md | Flex({ wrap: FlexWrap.Wrap }) {
Text('1').width('50%').height(50).backgroundColor(0xF5DEB3)
Text('2').width('50%').height(50).backgroundColor(0xD2B48C)
Text('3').width('50%').height(50).backgroundColor(0xD2B48C)
}
.width('90%')
.padding(10)
.backgroundColor(0xAFEEEE) |
application-dev\ui\arkts-layout-development-flex-layout.md | Flex({ wrap: FlexWrap.WrapReverse}) {
Text('1').width('50%').height(50).backgroundColor(0xF5DEB3)
Text('2').width('50%').height(50).backgroundColor(0xD2B48C)
Text('3').width('50%').height(50).backgroundColor(0xF5DEB3)
}
.width('90%')
.padding(10)
.backgroundColor(0xAFEEEE) |
application-dev\ui\arkts-layout-development-flex-layout.md | Flex({ justifyContent: FlexAlign.Start }) {
Text('1').width('20%').height(50).backgroundColor(0xF5DEB3)
Text('2').width('20%').height(50).backgroundColor(0xD2B48C)
Text('3').width('20%').height(50).backgroundColor(0xF5DEB3)
}
.width('90%')
.padding({ top: 10, bottom: 10 })
.backgroundColor(0xA... |
application-dev\ui\arkts-layout-development-flex-layout.md | Flex({ justifyContent: FlexAlign.Center }) {
Text('1').width('20%').height(50).backgroundColor(0xF5DEB3)
Text('2').width('20%').height(50).backgroundColor(0xD2B48C)
Text('3').width('20%').height(50).backgroundColor(0xF5DEB3)
}
.width('90%')
.padding({ top: 10, bottom: 10 })
.backgroundColor(0... |
application-dev\ui\arkts-layout-development-flex-layout.md | Flex({ justifyContent: FlexAlign.End }) {
Text('1').width('20%').height(50).backgroundColor(0xF5DEB3)
Text('2').width('20%').height(50).backgroundColor(0xD2B48C)
Text('3').width('20%').height(50).backgroundColor(0xF5DEB3)
}
.width('90%')
.padding({ top: 10, bottom: 10 })
.backgroundColor(0xAF... |
application-dev\ui\arkts-layout-development-flex-layout.md | Flex({ justifyContent: FlexAlign.SpaceBetween }) {
Text('1').width('20%').height(50).backgroundColor(0xF5DEB3)
Text('2').width('20%').height(50).backgroundColor(0xD2B48C)
Text('3').width('20%').height(50).backgroundColor(0xF5DEB3)
}
.width('90%')
.padding({ top: 10, bottom: 10 })
.backgroundC... |
application-dev\ui\arkts-layout-development-flex-layout.md | Flex({ justifyContent: FlexAlign.SpaceAround }) {
Text('1').width('20%').height(50).backgroundColor(0xF5DEB3)
Text('2').width('20%').height(50).backgroundColor(0xD2B48C)
Text('3').width('20%').height(50).backgroundColor(0xF5DEB3)
}
.width('90%')
.padding({ top: 10, bottom: 10 })
.backgroundCo... |
application-dev\ui\arkts-layout-development-flex-layout.md | Flex({ justifyContent: FlexAlign.SpaceEvenly }) {
Text('1').width('20%').height(50).backgroundColor(0xF5DEB3)
Text('2').width('20%').height(50).backgroundColor(0xD2B48C)
Text('3').width('20%').height(50).backgroundColor(0xF5DEB3)
}
.width('90%')
.padding({ top: 10, bottom: 10 })
.backgroundCo... |
application-dev\ui\arkts-layout-development-flex-layout.md | Flex({ alignItems: ItemAlign.Auto }) {
Text('1').width('33%').height(30).backgroundColor(0xF5DEB3)
Text('2').width('33%').height(40).backgroundColor(0xD2B48C)
Text('3').width('33%').height(50).backgroundColor(0xF5DEB3)
}
.size({ width: '90%', height: 80 })
.padding(10)
.backgroundColor(0xAFEEE... |
application-dev\ui\arkts-layout-development-flex-layout.md | Flex({ alignItems: ItemAlign.Start }) {
Text('1').width('33%').height(30).backgroundColor(0xF5DEB3)
Text('2').width('33%').height(40).backgroundColor(0xD2B48C)
Text('3').width('33%').height(50).backgroundColor(0xF5DEB3)
}
.size({ width: '90%', height: 80 })
.padding(10)
.backgroundColor(0xAFEE... |
application-dev\ui\arkts-layout-development-flex-layout.md | Flex({ alignItems: ItemAlign.Center }) {
Text('1').width('33%').height(30).backgroundColor(0xF5DEB3)
Text('2').width('33%').height(40).backgroundColor(0xD2B48C)
Text('3').width('33%').height(50).backgroundColor(0xF5DEB3)
}
.size({ width: '90%', height: 80 })
.padding(10)
.backgroundColor(0xAFE... |
application-dev\ui\arkts-layout-development-flex-layout.md | Flex({ alignItems: ItemAlign.End }) {
Text('1').width('33%').height(30).backgroundColor(0xF5DEB3)
Text('2').width('33%').height(40).backgroundColor(0xD2B48C)
Text('3').width('33%').height(50).backgroundColor(0xF5DEB3)
}
.size({ width: '90%', height: 80 })
.padding(10)
.backgroundColor(0xAFEEEE... |
application-dev\ui\arkts-layout-development-flex-layout.md | Flex({ alignItems: ItemAlign.Stretch }) {
Text('1').width('33%').backgroundColor(0xF5DEB3)
Text('2').width('33%').backgroundColor(0xD2B48C)
Text('3').width('33%').backgroundColor(0xF5DEB3)
}
.size({ width: '90%', height: 80 })
.padding(10)
.backgroundColor(0xAFEEEE) |
application-dev\ui\arkts-layout-development-flex-layout.md | Flex({ alignItems: ItemAlign.Baseline }) {
Text('1').width('33%').height(30).backgroundColor(0xF5DEB3)
Text('2').width('33%').height(40).backgroundColor(0xD2B48C)
Text('3').width('33%').height(50).backgroundColor(0xF5DEB3)
}
.size({ width: '90%', height: 80 })
.padding(10)
.backgroundColor(0xA... |
application-dev\ui\arkts-layout-development-flex-layout.md | Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { // The child elements are aligned with the center of the container.
Text('alignSelf Start').width('25%').height(80)
.alignSelf(ItemAlign.Start)
.backgroundColor(0xF5DEB3)
Text('alignSelf Baseline')
.alignSelf(ItemAlign.Baseline)
... |
application-dev\ui\arkts-layout-development-flex-layout.md | Flex({ justifyContent: FlexAlign.SpaceBetween, wrap: FlexWrap.Wrap, alignContent: FlexAlign.Start }) {
Text('1').width('30%').height(20).backgroundColor(0xF5DEB3)
Text('2').width('60%').height(20).backgroundColor(0xD2B48C)
Text('3').width('40%').height(20).backgroundColor(0xD2B48C)
Text('4').width('30%'... |
application-dev\ui\arkts-layout-development-flex-layout.md | Flex({ justifyContent: FlexAlign.SpaceBetween, wrap: FlexWrap.Wrap, alignContent: FlexAlign.Center }) {
Text('1').width('30%').height(20).backgroundColor(0xF5DEB3)
Text('2').width('60%').height(20).backgroundColor(0xD2B48C)
Text('3').width('40%').height(20).backgroundColor(0xD2B48C)
Text('4').width('30%... |
application-dev\ui\arkts-layout-development-flex-layout.md | Flex({ justifyContent: FlexAlign.SpaceBetween, wrap: FlexWrap.Wrap, alignContent: FlexAlign.End }) {
Text('1').width('30%').height(20).backgroundColor(0xF5DEB3)
Text('2').width('60%').height(20).backgroundColor(0xD2B48C)
Text('3').width('40%').height(20).backgroundColor(0xD2B48C)
Text('4').width('30%').... |
application-dev\ui\arkts-layout-development-flex-layout.md | Flex({ justifyContent: FlexAlign.SpaceBetween, wrap: FlexWrap.Wrap, alignContent: FlexAlign.SpaceBetween }) {
Text('1').width('30%').height(20).backgroundColor(0xF5DEB3)
Text('2').width('60%').height(20).backgroundColor(0xD2B48C)
Text('3').width('40%').height(20).backgroundColor(0xD2B48C)
Text('4').widt... |
application-dev\ui\arkts-layout-development-flex-layout.md | Flex({ justifyContent: FlexAlign.SpaceBetween, wrap: FlexWrap.Wrap, alignContent: FlexAlign.SpaceAround }) {
Text('1').width('30%').height(20).backgroundColor(0xF5DEB3)
Text('2').width('60%').height(20).backgroundColor(0xD2B48C)
Text('3').width('40%').height(20).backgroundColor(0xD2B48C)
Text('4').width... |
application-dev\ui\arkts-layout-development-flex-layout.md | Flex({ justifyContent: FlexAlign.SpaceBetween, wrap: FlexWrap.Wrap, alignContent: FlexAlign.SpaceEvenly }) {
Text('1').width('30%').height(20).backgroundColor(0xF5DEB3)
Text('2').width('60%').height(20).backgroundColor(0xD2B48C)
Text('3').width('40%').height(20).backgroundColor(0xD2B48C)
Text('4').width... |
application-dev\ui\arkts-layout-development-flex-layout.md | Flex() {
Text('flexBasis("auto")')
.flexBasis('auto') // When width is not set and flexBasis is set to auto, the content is at its own width.
.height(100)
.backgroundColor(0xF5DEB3)
Text('flexBasis("auto")'+' width("40%")')
.width('40%')
.flexBasis('auto') // When width is set and ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.