[英]Ionic 3 - Modal screen with rounded corners
How to round a modal screen like this link ?如何圆像这个链接的模态屏幕?
My CSS code is:我的 CSS 代码是:
.modal {
background: rgba(0, 0, 0, 0.5) !important;
padding: 25% 15% !important;
display: block;
border-radius: 25px;
}
modal.html模态.html
<ion-content>
<div class="subtitulo">
<h4>Select your city</h4>
</div>
<ion-list>
<button ion-item *ngFor="let cidade of cidades" (click)="selCidade(cidade)" detail-none>
<h3 text-wrap>{{ cidade.nome }}</h3>
<ion-icon name="ios-arrow-forward" item-right></ion-icon>
</button>
</ion-list>
</ion-content>
But the border-radius have no effect.但是边界半径没有影响。 I tried some tutorials, but no one has effect.
我尝试了一些教程,但没有一个效果。
I need some help in CSS for this case对于这种情况,我需要一些 CSS 方面的帮助
Tks, tks,
.square-modal .modal-wrapper { border-radius: 0px; }
async presentModal() {
const modal = await this.modalCtrl.create({
component: InvestorListPage,
componentProps: { id: 5, name: 'gaurav' },
cssClass: 'square-modal'
});
modal.onDidDismiss().then(result => {
console.log(result.data);
});
return await modal.present();
}
(tested with ionic4) (用ionic4测试)
Just posting the solution for ionic 4:刚刚发布了ionic 4的解决方案:
in global.scss, just change the scss variable of the ionic component "ion-modal"在 global.scss 中,只需更改离子组件“ion-modal”的 scss 变量
ion-modal {
--border-radius: 8px!important;
}
You can use overflow: hidden
.您可以使用
overflow: hidden
。 I hope it's will work.我希望它会起作用。
Thanks谢谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.