2017-09-27 7 views
2

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> 

は、しかし、これは私だけのページの幅の割合を取って終わるん。 item-end

item-contententer image description here

enter image description here

私は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> 
+0

現在の 'code'を表示できますか? – Sampath

+0

@Sampathサンプルコードを追加しました。 – Eraldo

答えて

2

item-endattributeを追加する必要があります。

:イオン項目コンポーネントは は、あなたがして full widthを使用する必要がある場合、そのコンポーネント

official Git Repo

<ion-item> 
    <ion-label floating>Keywords</ion-label> 
    <custom-input formControlName="content" item-end></custom-input> 
</ion-item> 

内transcludeするために使用することができセレクタのセットを事前に定義したためだ

<ion-item> 
    <ion-label floating>Keywords</ion-label> 
</ion-item> 
<ion-item> 
    <custom-input formControlName="content" item-start></custom-input> 
</ion-item> 
+0

あなたが正しいです - これは表示されますが、それは全幅ではありません(私が探しているものです)。スクリーンショットを追加して明確にする予定です。 – Eraldo

+0

'item-start'を使用してください。上記の更新された投稿を見てください。 – Sampath

+0

item-startも全幅を占めていませんが、item-startがなく、 'floating 'ラベルがないとダブルイオンアイテムが機能します。 – Eraldo

関連する問題