I want to have a line below a text view with a blue color I came across this post in this post having this as a one of the answer I tried it and is working fine but I want to change the color of the textview and the line below it.
just add this style:
style="?android:listSeparatorTextViewStyle"
to your TextView
I also have tried extracting the style but it is giving me error while inheriting the said style
My style is as follows
<style name="blueBoldText" parent="?android:listSeparatorTextViewStyle">
<item name="android:textColor">@color/DarkTurquoise</item>
<item name="android:textStyle">bold</item>
</style>
Actually, the value of the attribute
?android:listSeparatorTextViewStyle
is
@android:style/Widget.Holo.Light.TextView.ListSeparator
So you can inherit this style instead.
You can extend TextView and set listSeparatorTextViewStyle.
public class HeaderView extends TextView {
public HeaderView(Context context) {
super(context, null, android.R.attr.listSeparatorTextViewStyle);
}
public HeaderView(Context context,
AttributeSet attrs) {
super(context, attrs, android.R.attr.listSeparatorTextViewStyle);
}
}
then
<com.gmail.sikambr.alib.HeaderView
style="@style/your_style"
android:text="..."
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With