到处找,找不到解决办法。设置粗体或斜体很容易,为什么设置下划线就没那么容易了?
这是我的一些相关代码:
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/forgotpasswordHolder"
android:layout_marginTop="10dp">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Forgot your password?"
android:id="@+id/labForgotpassword"
android:textColor="#6BB08C"
android:layout_weight="1"
android:textStyle="bold|italic"
android:layout_gravity="left"
android:paddingLeft="20dp"
android:textIsSelectable="true"
android:singleLine="false" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Not a member?"
android:id="@+id/signup"
android:textColor="#6BB08C"
android:layout_weight="1"
android:textStyle="bold|italic"
android:singleLine="false"
android:layout_gravity="right"
android:gravity="right"
android:paddingRight="20dp"
android:textIsSelectable="true" />
</LinearLayout>
我有两个“忘记密码?”和“不是成员(member)?”按钮,如果我能在文本下划线,我会很高兴。
提前致谢!
使用 <u>
的字符串资源标签,像这样
android:text="@string/forgotPassword"
然后在strings.xml中,创建一个String
<string name="forgotPassword"><u>Forgot your password?</u></string>
我是一名优秀的程序员,十分优秀!