2017-12-31 292 views
1

ListViewは私のアプリケーションでは表示されません。 以下のようにレイアウトファイルにListViewが追加されましたが、エミュレータはイメージとして表示されます。ListViewが表示されません

enter image description here

<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
tools:context="com.example.yds.Pages.CokCikanListActivity" 
> 
<CheckBox 
    android:id="@+id/checkboxYapildimi" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_weight="1" 
    android:gravity="center" 
    android:color="#3bbdfa" 
    android:focusable="false" 
    android:focusableInTouchMode="false" /> 
<ListView 
    android:id="@+id/listViewCCList" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:divider="#ffffff" 
    android:dividerHeight="1dp" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentTop="true" 
    android:layout_weight="0.44" /> 

+1

回答を得るには、あなたの質問を編集して、何を求めているかを明確にする必要があります。 –

+0

@ sinan yilmazありがとう。プラス1。 – statosdotcom

答えて

0

あなたは、XMLのコンテンツ構造が欠落しています。以下にそれを変換:あなたはAPKを実行するとき、それは表示されません、

<android.support.constraint.ConstraintLayoutxmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
tools:context="com.example.yds.Pages.CokCikanListActivity" 
> 

<LinearLayout 
android:layout_width="match_parent" 
android:layout_height="wrap_content" 
android:gravity="center" 
android:orientation="vertical"> 

<CheckBox 
    android:id="@+id/checkboxYapildimi" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_weight="1" 
    android:gravity="center" 
    android:color="#3bbdfa" 
    android:focusable="false" 
    android:focusableInTouchMode="false" /> 

<ListView 
    android:id="@+id/listViewCCList" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:divider="#ffffff" 
    android:dividerHeight="1dp" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentTop="true" 
    android:layout_weight="0.44" /> 

</LinearLayout> 
0

エミュレータは、あなたがあなたには、いくつかのオブジェクトを挿入しますときになりますどのように理解させるための画像を表示し、それが唯一の例です何か...オブジェクトを挿入する場合は、Javaクラスで行う必要があります

0

アイテムを追加するまで、リストビューは空白のままなので何も表示されません。 XMLプレビューでは、リストビューは画像のように表示されますが、実際のアプリでは空白のままです。 リストに項目を追加すると、リストが表示されます。

関連する問題