【发布时间】:2018-03-08 19:49:55
【问题描述】:
如何将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>
【问题讨论】:
-
你能显示你当前的
code吗? -
@Sampath 我添加了一些示例代码。
标签: angular typescript ionic2 ionic3