DetailTitleSummaryView.ets 1.77 KB
import router from '@ohos.router';

const FULL_PARENT: string = '100%';

const TAG = 'DetailTitleSummaryView';

@Entry
@Component
export struct DetailTitleSummaryView {
  @State title: string = 'title'
  @State newsSummary: string = 'newsSummary'

  aboutToAppear() {
    this.newsSummary = 'newsSummary 0 newsSummary newsSummary newsSummary newsSummary newsSummary 0 newsSummary newsSummary newsSummary newsSummary'
  }

  build() {
    Stack() {
        Text('1')
          .width('100%')
          .margin({ top: 10 })
          .fontColor(Color.White)
          .fontSize(30)
          .maxLines(1)

    }
    .height('60%')
    .backgroundColor(Color.Black)

    // Column() {
    //   Text(this.title)
    //     .width('100%')
    //     .margin({ top: 10 })
    //     .fontColor(Color.White)
    //     .fontSize(30)
    //     .maxLines(1)
    //
    //   List() {
    //     ListItem() {
    //       Text(this.newsSummary)
    //         .width(FULL_PARENT)
    //         .fontWeight(FontWeight.Bold)
    //         .fontColor(Color.White)
    //         .maxLines(10)
    //         .textOverflow({ overflow: TextOverflow.Ellipsis })
    //     }
    //   }
    //   .constraintSize({ maxHeight: '40%' })
    //   .margin({ top: 5 })
    //
    //   Image($r('app.media.ic_close'))
    //     .height(24)
    //     .width(24)
    //     .margin({ top: 10 })
    //     .alignRules({
    //       right: { anchor: "__container__", align: HorizontalAlign.End },
    //       center: { anchor: "__container__", align: VerticalAlign.Center } })
    //     .id('img_close')
    //     .onClick((event: ClickEvent) => {
    //       // console.info(TAG, "img_close")
    //       router.back()
    //     })
    // }
    // .margin({ left: 14, right: 14 })
    // .backgroundColor(Color.Black)
  }
}