0

で信じられないほどの問題がTextViewありListViewます。TextViewAndroid 4.2.2の最初の行ListViewは黒色です。(Nexus 4) Android 4.2.1 以前では色がありません。4.2.2 へのアップデートを受け取るまで、私の HTC One ではすべて問題ありませんでした。TextView最初の 2 行の s の背景が黒になりました。最初の行が黒の Nexusのスクリーンショットは、さらに詳しく説明しています。

アダプターのコードは次のとおりです。

public class NotificationsAdapter extends ArrayAdapter<Object> {

private ArrayList<Object> items;
Context context;    
private LayoutInflater mInflater;
Typeface rb;
Typeface bn;
Typeface rr;
Typeface rbc;

public NotificationsAdapter(Context context, int textViewResourceId, ArrayList<Object> items) {
        super(context, textViewResourceId, items);     
        this.context = context;            
        this.items = items; 
        mInflater = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        rb = Typeface.createFromAsset(getContext().getAssets(), "Roboto-Bold.ttf");
        bn = Typeface.createFromAsset(getContext().getAssets(), "BebasNeue.otf");
        rr = Typeface.createFromAsset(getContext().getAssets(), "Roboto-Regular.ttf");
        rbc = Typeface.createFromAsset(getContext().getAssets(), "Roboto-BoldCondensed.ttf");
}

@Override
public View getView(int position, View convertView, ViewGroup parent) {     

        int type;
        if(items.get(position).getClass().equals(String.class))
            type = 0;
        else
            type = 1;          

        if(type == 0){
            String m = (String)items.get(position);
            if (m != null) {                
                convertView = mInflater.inflate(R.layout.notification_month_row, null);
                TextView month_date = (TextView)convertView.findViewById(R.id.tw_notification_month);   
                month_date.setTypeface(rb);
                month_date.setText(m);                      
            }
        }
        else{                         
            Notifications o = (Notifications)items.get(position);
            if (o != null) { 
                convertView = mInflater.inflate(R.layout.notification_row, null);
                TextView month_date = (TextView)convertView.findViewById(R.id.tw_notification_date);
                TextView title = (TextView)convertView.findViewById(R.id.tw_notification_title);
                TextView note = (TextView)convertView.findViewById(R.id.tw_notification_description);
                ImageView mark = (ImageView)convertView.findViewById(R.id.iv_notification_marker);
                title.setTypeface(bn);
                title.setText(o.getTitle());                    
                note.setTypeface(rr);
                note.setText(o.getDescription());                       
                month_date.setTypeface(rbc);
                month_date.setText(o.getDate());                        
                if(o.getConfirmed().equals("1")){
                    mark.setVisibility(4);
                }else{
                    mark.setVisibility(0);
                }                                       
            }
        }

        return convertView;
    }

なぜそれが起こっているのか誰にも分かりますか?

ここに XML:

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"    
android:layout_width="fill_parent"
android:layout_height="fill_parent"   
android:layout_margin="0dp"
android:paddingTop="0dp"
android:paddingBottom="25dp"    
android:background="@drawable/background_cell_profile"    
 >     


 <RelativeLayout 
     android:layout_width="fill_parent"
     android:layout_height="wrap_content" >
 <TextView 
        android:id="@+id/tw_notification_title"             
        android:layout_toLeftOf="@+id/tw_notification_date"
        android:layout_alignParentLeft="true"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"             
        android:layout_marginTop="25dp"        
        android:layout_marginLeft="10dp" 
        android:layout_marginRight="10dp"   
        android:lines="1"     
        android:singleLine="true"
        android:ems="3"     
        android:ellipsize="end"         
        android:textSize="27sp"
        android:textColor="#ffffff"
        android:shadowColor="#000000"
        android:shadowDy="-2"
        android:shadowRadius="0.1"
        android:clickable="false" 
        android:focusable="false"/>

 <TextView 
        android:id="@+id/tw_notification_date"
        android:layout_marginTop="25dp"
        android:layout_alignParentRight="true"         
        android:layout_marginLeft="10dp"            
        android:layout_marginRight="10dp"           
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"                             
        android:textSize="20sp"
        android:textColor="#ffffff"
        android:shadowColor="#000000"
        android:shadowDy="-2"
        android:shadowRadius="0.1"
        android:clickable="false" 
        android:focusable="false"/>

 <TextView 
        android:id="@+id/tw_notification_description"
        android:layout_below="@+id/tw_notification_title"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"            
        android:layout_marginLeft="10dp" 
        android:layout_marginTop="10dp" 
        android:layout_marginRight="10dp"                                   
        android:textSize="14sp"
        android:textColor="@color/gray_to_white"
        android:shadowColor="#000000"
        android:shadowDy="-2"
        android:shadowRadius="0.1"
        android:clickable="false" 
        android:focusable="false"/>    
</RelativeLayout>

 <ImageView 
     android:id="@+id/iv_notification_marker"
     android:layout_width="40dp"
     android:layout_height="40dp"
     android:padding="0dp"
     android:layout_marginTop="0dp"
     android:layout_gravity="right|top"
     android:src="@drawable/icon_oznameni_unreadindicator"/>

4

1 に答える 1