appcompat - Divider lines are not correct on Android 5 and Android 4 phones -
in android application, migrating app "com.android.support:preference-v14:23.4.0" settings screen. using theme.appcompat theme. works fine on android 6 phones.
but on android 5 , android 4 phones, noticed divider lines "black" in color. used dark theme, should white (with alpha). case android 6 phones, not android 5 , android 4.
i tried lot change divider color unable so. loooked solutions on internet nothin seem work. can me this
you can use setdivider method provided preferencefragmentcompat class. change style of divider. use method need sure view created otherwise nullpointer error. best place change style in onviewcreated.
example:
@override public void onviewcreated(view view, @nullable bundle savedinstancestate) { super.onviewcreated(view, savedinstancestate); setdividerstyle(); } private void setdividerstyle() { colordrawable test = new colordrawable(getactivity().getresources().getcolor(r.color.your color)); setdivider(test); setdividerheight(1); }
Comments
Post a Comment