如何使用ion-label
以及100%宽度的自定义窗体控件? 目前只要我在我的表单中添加一个ion-label
到我的ion-item
,我正在使用自定义窗体控件(而不是ion-input
),我的自定义窗体控件字段不再可见。带定制全宽窗体控件的离子标签
那么,我可以改变什么使ion-label
与自定义窗体控件一起工作?
示例代码:
<ion-item>
<ion-label floating>Keywords</ion-label>
<custom-input formControlName="content"></custom-input>
</ion-item>
我也试过这样:
<!-- Item with a label and content -->
<ion-item>
<ion-label>
Item Label
</ion-label>
<div item-content>
Item Content will be next to the label (not full width)
<custom-input formControlName="content" item-end></custom-input>
</div>
</ion-item>
但是这并最终只考虑我的页面宽度的一小部分。
我想custom-input
是100%宽度(例如文本编辑器)
解决方案
由双项的启发来自@Sampath的想法:
<ion-item no-lines>
<ion-label>Content</ion-label>
</ion-item>
<ion-item>
<custom-input formControlName="content"></custom-input>
</ion-item>
你可以显示你当前的“代码”吗? – Sampath
@Sampath我添加了一些示例代码。 – Eraldo