问题描述
起亚·奥拉(Kia Ora),我试图将两个按钮并排放置,如下图所示,但我努力使两个按钮并排放置,即使没有角度也要全长,我不确定它是否可能?
这是我当前使用和ion-grid的代码,但是它们只是并排显示为两个按钮而不是完整长度,我想如果将expand属性设置为full,那么它应该是完整长度吗?
<ion-grid>
<ion-row>
<ion-col col-6>
<ion-button expand="full" share="round" color="light">settings</ion-button>
</ion-col>
<ion-col col-6>
<ion-button expand="full" share="round" color="gold">edit profile</ion-button>
</ion-col>
</ion-row>
解决方法
问题是expand="full"
用于Ionic 4/5,但是您正在使用Ionic 3(根据问题的标签)。
在Ionic 3中,您应该改为使用full
属性:
https://ionicframework.com/docs/v3/components/#full-buttons
<button ion-button full>Full Button</button>
请注意,正确的组件是<button ion-button>...</button>
,而不是<ion-button>...</ion-button>
,因为这也适用于Ionic 4/5。