<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id="@+id/btn_login"
android:layout_width="match_parent"
android:layout_height="36dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:gravity="center"
android:text="登錄"
app:layout_constraintTop_toTopOf="parent"
app:qmui_backgroundColor="@color/black"
app:qmui_isRadiusAdjustBounds="true" />
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id="@+id/btn_login_out"
android:layout_width="match_parent"
android:layout_height="36dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:gravity="center"
android:text="注銷"
app:layout_constraintTop_toBottomOf="@id/btn_login"
app:qmui_backgroundColor="@color/black"
app:qmui_isRadiusAdjustBounds="true" />
<ImageView
android:id="@+id/image_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="8dp"
android:rotation="90"
android:src="https://bbs.csdn.net/topics/@drawable/qmui_icon_quick_action_more_arrow_left"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btn_login_out" />
</androidx.constraintlayout.widget.ConstraintLayout>
fragment中
view.findViewById(R.id.image_view).setOnClickListener(v -> {
Log.d("MineFragment", "initEventAndData: ");
}
);
在螢屏上實際點擊區域,紅色框里面的都有事件回應,求問為啥呢

implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
uj5u.com熱心網友回復:
約束布局換成線性布局也一樣,換了圖片也是這樣
uj5u.com熱心網友回復:
新建一個專案都是這樣<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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=".MainActivity">
<ImageView
android:id="@+id/image_view"
android:layout_width="match_parent"
android:layout_height="137dp"
android:layout_marginTop="52dp"
android:padding="8dp"
android:rotation="90"
android:src="https://bbs.csdn.net/topics/@drawable/ic_back"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
uj5u.com熱心網友回復:
1.accelerate_iv_arrow這個id的控制元件是哪一個呢?2.點擊區域確定是在ImageView外?
3.可以留個遠程方式看
uj5u.com熱心網友回復:
1、就是imageview,往改了
2、確定,很大的區域,點擊其他控制元件都能回應
3、罷了,你可以新建一個專案都能出現
as 版本號 4.2.1
build.gradle 頂層 4.2.1
gradle版本 6.7.1-bin
uj5u.com熱心網友回復:
虛擬機真機都是這狀況轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/285029.html
標籤:Android
上一篇:Duplicate class android.support.v4.app.INotificationSideChannel found in modules
下一篇:生成 tinkerPatch 熱補丁出錯,求解 com.tencent.tinker.android.dex.DexException
