java - Why is setBackgroundColor() failing only with my custom theme? -


I thought I successfully created a striped Android list view, in which the background color of the items in the list is optional. When I use the theme, it works perfectly.Hello. As the theme of my application (in the manifest) However, when I defined a custom theme for my app, the straps disappeared, with custom background color, a background color defined in my theme is why my custom theme by setBackgroundColor () in GetView () Can not background color override? How can I fix this issue? Thank you!

Update: I have realized that the application background is being presented in front of my background background! (Also, in front of Barbar, in front of me, a progress in my layout, it was completely obscured.) If I set the color / background tag to be completely transparent, then the striping shows. So, the question is, Why is my theme background rendering in front of some subject / background?

Theme:

  & lt; Style name = "original" & gt; & Lt; Item name = "android: textcolor" & gt; # 000000 & lt; / Item & gt; & Lt; Item name = "Android: Background" & gt; @color / background_color & lt; / Item & gt; & Lt; / Style & gt;   

getView ():

  @ override public view getView (integer status, see convertview view, ViewGroup parent) {LinearLayout itemView; Resource res = getResources (); Int [] Color = New Int [] {res.getColor (R.color.list_stripe_1), res.getColor (R.color.list_stripe_2)}; If (convertView == faucet) {itemView = New LinearLayout (getContext ()); String flatters = context. LAYOUT_INFLATER_SERVICE; LayoutInflator Visual Inflator; ViewInflater = (layoutInflator) getContext (). GetSystemService (inflater); ViewInflater.inflate (resource, itemview, true); } Else {itemView = (LinearLayout) Convertview; } //// Removing the code to popularize the contents. ItemView.setBackgroundColor (color [condition% colors.length]); See Return Items; Instead of using Android settings: Set Background, Android in Themes:    



Comments