首页设置壁纸及修改部分WebView
This commit is contained in:
@@ -54,7 +54,7 @@ struct Index {
|
||||
.width('100%')
|
||||
.alignRules({
|
||||
top: { anchor: ComponentConst.ContainerId, align: VerticalAlign.Top },
|
||||
left: { anchor: ComponentConst.ContainerId, align: HorizontalAlign.Start }
|
||||
left: { anchor: ComponentConst.ContainerId, align: HorizontalAlign.Start },
|
||||
}).id("title_bar"); //必须要设置id 否则不显示
|
||||
|
||||
Divider().alignRules({
|
||||
@@ -84,7 +84,7 @@ struct Index {
|
||||
Button("1").type(ButtonType.Capsule).height(32).width(80);
|
||||
}.rowStart(1).rowEnd(1).columnStart(0).columnEnd(0)
|
||||
}
|
||||
.width('100%').backgroundColor('#FF005566')
|
||||
.width('100%')
|
||||
.columnsTemplate('1fr 1fr 1fr 1fr').columnsGap(8)
|
||||
.rowsTemplate('repeat(auto-fill, 36)').rowsGap(8)
|
||||
.alignRules({
|
||||
@@ -93,6 +93,6 @@ struct Index {
|
||||
bottom: { anchor: ComponentConst.ContainerId, align: VerticalAlign.Bottom }
|
||||
}).id("host_web") //必须要设置id 否则不显示
|
||||
}.width('100%').height('100%')
|
||||
}.width('100%').height('100%')
|
||||
}.width('100%').height('100%').backgroundImage($r("app.media.bg_sky")).backgroundImageSize(ImageSize.Cover)
|
||||
}
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
import { WebView, ComponentConst, CommonRes, TitleBar, WebViewController, ScreenUtil } from '@devwiki/common_ui';
|
||||
import { WebViewParam } from '@devwiki/common_ui/src/main/ets/component/web/WebView';
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
@@ -40,7 +41,7 @@ export struct WebPage {
|
||||
left: { anchor: ComponentConst.ContainerId, align: HorizontalAlign.Start }
|
||||
}).width('100%').id("divider")
|
||||
|
||||
WebView({ webUrl: this.isPortrait? this.viewModel?.webUrl : "https://blog.devwiki.net", controller: this.webViewController }).width('100%')
|
||||
WebView({ param: this.viewModel.webParam, controller: this.webViewController }).width('100%')
|
||||
.alignRules({
|
||||
top: { anchor: "divider", align: VerticalAlign.Bottom },
|
||||
left: { anchor: ComponentConst.ContainerId, align: HorizontalAlign.Start },
|
||||
@@ -70,7 +71,11 @@ class WebPageController extends WebViewController {
|
||||
}
|
||||
|
||||
class WebPageViewModel {
|
||||
webUrl: string = "https://devwiki.net";
|
||||
|
||||
webParam: WebViewParam = {
|
||||
webUrl: "https://devwiki.net"
|
||||
};
|
||||
|
||||
pageTitle: ResourceStr = "";
|
||||
|
||||
constructor() {
|
||||
|
BIN
app/src/main/resources/base/media/bg_sky.jpeg
Normal file
BIN
app/src/main/resources/base/media/bg_sky.jpeg
Normal file
Binary file not shown.
After Width: | Height: | Size: 585 KiB |
Reference in New Issue
Block a user