問題タブ [formatted]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
141 参照

android - データ バインディングを使用した XML ファイルからの書式設定された文字列のバインドが正しく機能しない

データ バインディングを使用して開発し、書式設定された文字列を XML ファイルに直接バインドする場合、 はデータ バインディングなし@{@string/stringName}では通常の属性として機能せず、 も機能しません。@string/stringName@{String.format(@string/stringName)}

正しく機能しない<string name="my_string"> <font face="font_name" color="hex_color"> my text here with %s </font> </string>ため、データ バインディングを使用して、データ バインディングなどの書式設定された文字列を使用する方法を知りたいです。@{@string/my_string("My name")}つまり、文字列に「私の名前」が挿入されて表示されますが、フォントや色などの書式設定された属性は表示されません。

データバインディングを使用せず@string/myName、フォーマットされた属性のフォントと色だけが適切に機能する場合、 %s.

皆さん、ありがとうございました。