0
<TextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="2dp"
        android:layout_marginLeft="10dp"
        android:text="Don&apos;t worry we will never share this with anyone\nBy Clicking register you are indicating that you have read and agreed to the \n **Terms of services**  and **Privacy Policy**"
        android:textColor="@android:color/black" 
        android:textSize="8.5sp"
    />

上記のコードから、太字で強調表示されている利用規約とプライバシー ポリシーに下線を引く必要があります。

使用してみ<u></u>ましたが、うまくいきません。

また、利用規約、プライバシー ポリシーのみのフォントを大きくする必要があります。

いくつかの提案をしてください。

4

2 に答える 2

1

ファイルでテキストを定義する必要があります。strings.xmlはい、フォーマットされた html も定義できます。

だからあなたはこれを試すことができます:

<string name="nice_html">
<![CDATA[Don&apos;t worry we will never share this with anyone<br/>
By Clicking register you are indicating that you have read and agreed to the <br/>
 <u>Terms of services</u>  and <u>Privacy Policy</u>
]]></string>

次に、コードで:

TextView foo = (TextView)findViewById(R.id.foo); foo.setText(Html.fromHtml(getString(R.string.nice_html)));

元の答え

これが最もクリーンな方法です。

于 2013-02-12T10:14:52.710 に答える
0
String mString=new String("Don&apos;t worry we will never share this with anyone\nBy Clicking register you are indicating that you have read and agreed to the \n **Terms of services**  and **Privacy Policy**");
SpannableString span = new SpannableString(mString);
span.setSpan(new UnderlineSpan(), index of T in terms, mString.length(), 0);
mTextView.setText(span);
于 2013-02-12T10:12:12.963 に答える