Yes I searched the repo and Stack Overflow for existing questions and solutions.
After updating to NS 3.0, I am not able to set background color of Modal dialog page to transparent on Android. It was working fine with NS 2.5 with tns-core-modules 2.4.2.
Android
node_modules/tns-core-modules/package.json file in your project)"tns-android" and "tns-ios" properties in thepackage.json file of your project)package.json file of yourโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโ Component โ Current version โ Latest version โ Information โ
โ nativescript โ 3.0.2 โ 3.0.2 โ Up to date โ
โ tns-core-modules โ โ 3.0.1 โ Not installed โ
โ tns-android โ โ 3.0.1 โ Not installed โ
โ tns-ios โ โ 3.0.1 โ Not installed โ
โโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโดโโโโโโโโโโ
Try creating a modal page with backgroundColor set to transparent.
Also tried setting background-color: transparent on css also tried setting backgroundColor="#00000000"
modalPage.xml
<Page xmlns="http://schemas.nativescript.org/tns.xsd" shownModally="onShownModally">
<GridLayout class="mainstack" rows="auto, auto" columns="auto">
<Label text=" " class="avatar-circle-halo" row="0" />
<Label text="" horizontalAlignment="center" class="avatar-circle-icon" row="0" />
<GridLayout rows="auto, auto, auto, auto, auto" columns="auto" class="headerFooter" row="1">
<Label text="Connect with Us" class="headingtxt align-center" row="0"/>
<Button text=" Twitter" horizontalAlignment="center" tap="moveTo" class="socialbtn" row="1" id="twitter"/>
<Button text=" Facebook" horizontalAlignment="center" tap="moveTo" class="socialbtn" row="2" id="fb"/>
<Button text=" Instagram" horizontalAlignment="center" tap="moveTo" class="socialbtn" row="3" id="insta"/>
<Button text=" YouTube" horizontalAlignment="center" tap="moveTo" class="socialbtn" row="4" id="youtube"/>
</GridLayout>
</GridLayout>
</Page>
modalPage.css
.mainstack {
margin-left: 10;
margin-right: 10;
margin-top: 10;
background-color: transparent;
opacity: 0.8;
border-radius: 10;
}
.socialbtn {
font-family: FontAwesome, fontawesome;
padding: 10;
font-size: 24;
background-color: #7D110C;
color: white;
border-radius: 15;
height: 45;
width: 160;
margin-left: 20;
margin-right: 20;
margin-bottom: 10;
margin-top: 2;
text-transform: capitalize;
}
.headerFooter {
background-color: white;
border-radius: 10;
width: 200;
}
.avatar-circle-icon {
font-size:40px;
height: 50;
width: 50;
color: #fff;
background-color: #7D110C;
border-radius: 30;
margin-left: 12;
margin-top: 3.75;
margin-bottom: 3.75;
text-align: center;
font-family: MaterialIcons, Material Icons;
vertical-align: middle;
}
.avatar-circle-halo {
/*font-size:20;*/
height: 60;
width: 60;
color: #fff;
background-color: white;
border-radius: 30;
margin-left: 12;
margin-top: 3.75;
margin-bottom: 3.75;
text-align: center;
font-family: MaterialIcons, Material Icons;
font-weight: normal;
font-style: normal;
font-size: 42px; /*Preferred icon size */
}
Before update->

After update->

@sudhanshu-15 this occurs because the default color of the modal page is not transparent.
To overcome this just assign a background color to your page inline or via CSS.
e.g. in modalPage.xml
<Page shownModally="onShownModally" backgroundColor="transparent" xmlns="http://schemas.nativescript.org/tns.xsd">
Full demonstration can be found here
@NickIliev thank your for looking into it. It is working now.
@NickIliev I have exactly the same problem using NativeScript 5.1.
<Page shownModally="onShownModally" backgroundColor="transparent">
This makes no difference, I cannot see anything that is behind the modal page because it is not transparent at all.
I have the same issue while trying to use border radius on the top level StackLayout of my modal. My stack layout gets rounded corners, but there's a white background visible under them.
I have tried:
constructor(
private params: ModalDialogParams,
private page: Page,
private modalDataService: ModalDataService) {
this.page.frame.backgroundColor = 'transparent';
this.page.frame.borderRadius = "20";
this.page.backgroundColor ='transparent';
this.page.borderRadius = "20";
}
with no effect. The white background is there no matter what.
I have a similar issue with {N} v. 6.0.0 and the same for the runtimes.
Also, on ios i've encountered that the page is slightly visible when background colour is set to transparent. Think @brandon-sigao and I might experience the same issue.