android-textattributes

Change EditText hint color when using TextInputLayout

廉价感情. 提交于 2019-11-26 17:30:38
I am using the new TextInputLayout from the design library. I am able to get it to show and to change the color of the floating label. Unfortunately the actual EditText hint is now always white. I have tried changing the hintColor in XML, styles, and programmatically and also tried using the android.support.v7.widget.AppCompatEditText but the EditText hint always shows white. Here is my XML for my TextInputLayout and EditText <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" android.support.design:hintTextAppearance="@style

how to make a specific text on TextView BOLD

。_饼干妹妹 提交于 2019-11-26 11:10:20
I don't know how to make a specific text on TextView become BOLD. its like this txtResult.setText(id+" "+name); I want the output to be like this: 1111 neil id and name are variables that I have retrieved the value from database, and I want to make the id to bold, but only the id so the name will not affected, I have no idea how to do this. Just build your String in HTML and set it: String sourceString = "<b>" + id + "</b> " + name; mytextview.setText(Html.fromHtml(sourceString)); wtsang02 While you can use Html.fromHtml() you can use a more native approach which is SpannableStringBuilder ,

how to make a specific text on TextView BOLD

邮差的信 提交于 2019-11-26 02:17:35
问题 I don\'t know how to make a specific text on TextView become BOLD. its like this txtResult.setText(id+\" \"+name); I want the output to be like this: 1111 neil id and name are variables that I have retrieved the value from database, and I want to make the id to bold, but only the id so the name will not affected, I have no idea how to do this. 回答1: Just build your String in HTML and set it: String sourceString = "<b>" + id + "</b> " + name; mytextview.setText(Html.fromHtml(sourceString)); 回答2