2017-09-21 4 views
0

私はBastAdapterを使用して、私はcustomAutoCompleteTextViewをクリックすると、履歴メッセージのリストを作りたい、と はどのようにアイテムを常にリストに入れることができますか?

Image is here

赤丸の部分を作ったが、私は「すべてクリア」アイテム何をするか分かりません常に表示されます 、私は履歴のリストに新しい項目を追加したくありません。 どうすればいいですか?

+0

あなたは 'クリアALL'をクリックした場合、あなたはそれ.Isn't履歴データやその他のデータを削除したいですか? – KeLiuyue

+1

カスタム 'AutoCompleteTextView'で、カスタムドロップダウンリストを表示している場合は、ドロップダウンリストとして表示されている' ListView'にフッターを追加し、ボタンまたは 'TextView.'として「すべてクリア」を追加できます。 –

+0

@ KeLiuyue that's right –

答えて

0

はこれを試してみてください。

<?xml version="1.0" encoding="utf-8"?><!-- File created by SkillsOn --> 
<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

    <!--This could be anything that shows your Message list--> 
    <ListView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_alignParentTop="true" 
     android:layout_below="@+id/clearAll"/> 

    <!--This is clearAll button and is always visible--> 
    <Button 
     android:id="@+id/clearAll" 
     android:text="Clear all" 
     android:layout_alignParentBottom="true" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_gravity="bottom"/> 
</RelativeLayout> 
+0

CustomAutoCompleteTextViewレイアウトの設定方法は、item_layout –

関連する問題