[英]Change Background Image of View, NativeScript (Android application)
我正在嘗試更改我的android移動應用程序視圖的背景圖像。 我正在使用NativeScript創建一個混合應用程序,但是它不起作用。
視圖的XML
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="onNavigatingTo" actionBarHidden="true" >
<StackLayout orientation="vertical">
<Image src="rec://logo" stretch="none" horizontalAlignment="center"/>
<Button text="Click" />
<Button text="Click"/>
</StackLayout>
視圖的CSS:
Page{
background-image: url('~/images/back.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center;
background-size: cover;
}
注意:我要為背景放置的圖像是back.jpg,它位於app文件夾下的images文件夾中。
我認為background-image屬性需要一些調整,我對其定義如下,並且可以正常工作: background-image: ~/images/bg_intro_pin.jpg
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.