c# - 如何在xamarin android中的framelayout内触摸图像时启用
问题描述
我在框架布局中使用 Imageview 和文本视图,当我被触摸时只检测图像区域,如何实现这一点。谢谢提前
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_gravity="center"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorAccent">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/frameLayout1"
android:background="@android:color/black"
android:clickable="true">
<ImageView
android:src="@drawable/Car"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/imageView1" />
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="#FFFFFF"
android:textStyle="bold"/>
</FrameLayout>
</RelativeLayout>
解决方案
推荐阅读
- node.js - TypeScript 节点服务器与 Web 组装服务器
- python - 向导库存:与库存混淆以及如何使用我拥有的代码更改值
- spring-boot - 在使用 Springboot 运行集成测试时启动嵌入式 gRPC 服务器
- codeigniter - Codeigniter:如何从视图打印数组数组到模型
- spring - JUnit/Mockito:ArgumentCaptor 在 JUnit 测试执行之前运行?
- html - 混合混合模式:差异不适用于 Chrome
- javascript - 使用 JavaFX 加载谷歌地图 html
- python-3.x - sqlite 值不会更新
- file - 如何在 nginx + tomcat 反向代理上下载 excel 文件?
- kotlin - 具有实现该接口的类的泛型类型的接口?