布局:
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
android:orientation="vertical" >
android:layout_width="match_parent"
android:layout_height="48dip"
android:background="#B0C4DE"
android:layout_alignParentBottom="true"
android:orientation="horizontal" >
android:id="@+id/tv"
android:layout_width="50dp"
android:layout_height="50dp"
android:drawableTop="@mipmap/zxj64"
android:textSize="11sp"
android:layout_gravity="top"
android:layout_marginTop="-25dp"
android:gravity="center"
android:background="@drawable/bg"
android:padding="5dp"
android:textColor="#ffffff"
android:focusable="true"
android:text="act"
android:src="@drawable/ic_launcher_background" />
码:
val tv = findViewById(R.id.tv)
tv.setOnClickListener {
Toast.makeText(this,"hello!",Toast.LENGTH_SHORT).show()
}
我想使用android:clipChildren属性来达到超出父视图的效果,但是它无法响应单击事件,我没有办法,我无法启动。 我搜寻了一天,整个网络都没有答案。 请帮帮我。
我上载了所有代码,这提示我编写了太多代码,我只能删除其中一部分,然后变得很奇怪。 实际上是底部导航栏