Вопрос по android – Как вы подчеркиваете текст в Android XML?

86

Error: User Rate Limit ExceededtextStyle.

Error: User Rate Limit Exceeded Michael Zeuner
Error: User Rate Limit ExceededtextView.setText(Html.fromHtml("<u>"+"testest"+"</u>")); ρяσѕρєя K
Error: User Rate Limit Exceededstyle="text-decoration: underline;" ρяσѕρєя K

Ваш Ответ

9   ответов
3

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

    <resource>
        <string name="your_string_here">This is an <u>underline</u>.</string>
    </resources>
Error: User Rate Limit Exceeded
1

Error: User Rate Limit ExceededtextAllCapsError: User Rate Limit ExceededtrueError: User Rate Limit Exceeded

<resource>
    <string name="my_string_value">I am <u>underlined</u>.</string>
</resources>


Note

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

51

Error: User Rate Limit Exceeded

TextView txt = (TextView) findViewById(R.id.Textview1);
txt.setPaintFlags(txt.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
Error: User Rate Limit Exceeded
Error: User Rate Limit ExceededUnderlineSpan.
144

Error: User Rate Limit Exceeded<b> </b>, <i> </i>Error: User Rate Limit Exceeded<u> </u>.

<resources>
    <string name="your_string_here">
        This is an <u>underline</u>.
    </string>
</resources>

Error: User Rate Limit Exceeded

TextView tv = (TextView) view.findViewById(R.id.tv);
SpannableString content = new SpannableString("Content");
content.setSpan(new UnderlineSpan(), 0, content.length(), 0);
tv.setText(content);

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded<u> теги не работают, например иногда, если вы используете собственный шрифт. Тем не менее, программноUnderlineSpanError: User Rate Limit Exceeded
Error: User Rate Limit Exceeded Michael Zeuner
Error: User Rate Limit Exceeded
Вам не нужно устанавливать текст на Java. Просто используйте<u>Error: User Rate Limit Exceeded<\u>Error: User Rate Limit Exceeded
2

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

package com.myapp.components;

import android.content.Context;
import android.support.v7.widget.AppCompatTextView;
import android.text.SpannableString;
import android.text.style.UnderlineSpan;
import android.util.AttributeSet;

public class LinkTextView extends AppCompatTextView {
    public LinkTextView(Context context) {
        this(context, null);
    }

    public LinkTextView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public void setText(CharSequence text, BufferType type) {
        SpannableString content = new SpannableString(text);
        content.setSpan(new UnderlineSpan(), 0, content.length(), 0);

        super.setText(content, type);
    }
}

Error: User Rate Limit Exceeded

<com.myapp.components.LinkTextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="Hello World!" />
1

Error: User Rate Limit Exceeded

Button btnClickMe= (Button) findViewById(R.id.btn_click_me);
btnClickMe.setPaintFlags(btnClickMe.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
0

Error: User Rate Limit Exceeded

1.<u>This is my underlined text</u>Error: User Rate Limit Exceeded

I just want to underline <u>this</u> word

Error: User Rate Limit Exceeded

`textView.setPaintFlags(textView.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);`

Error: User Rate Limit Exceeded

SpannableString text = new SpannableString("Voglio sottolineare solo questa parola");
text.setSpan(new UnderlineSpan(), 25, 6, 0);
textView.setText(text);
19
<resource>
    <string name="your_string_here">This is an <u>underline</u>.</string>
</resources>

Error: User Rate Limit Exceeded

<resource>
<string name="your_string_here">This is an &lt;u>underline&lt;/u>.</string>

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

TextView textView = (TextView) view.findViewById(R.id.textview);
textView.setText(Html.fromHtml(getString(R.string.your_string_here)));
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
0

Error: User Rate Limit Exceeded

((TextView) findViewById(R.id.tv_cgu)).setText(Html.fromHtml(getString(R.string.upload_poi_CGU)));

<string name="upload_poi_CGU"><![CDATA[ J\'accepte les <a href="">conditions générales</a>]]></string>

Error: User Rate Limit ExceededError: User Rate Limit Exceeded

Похожие вопросы