0
ListViewの外にButtonがあり、ボタンをクリックしました(onClickListener)が機能していません。私はandroid:focus = "false"、android:descendantFocusability = "blocksDescendants"を試しましたが、正しく使用したかどうかは分かりません。全く役に立たなかった。私はアンドロイドの初心者です、私はそれを修正するのを助けてください。ありがとうございました。ListViewの外で定義されたボタンが動作しません
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="false">
<Button
android:text="Button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/b1"/>
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/listView1"/>
</LinearLayout>
ボタンが表示されていますが、クリックが認識されません(onClickListenerが機能していません)。 – Shreesha
その後、urのonclicklistenerコードを投稿してください。エラーがどこにあるのか分かります。 – EED