gpt4 book ai didi

java - 无法使用TabLayout在RelativeLayout中的ImageButton上获得链式 react

转载 作者:行者123 更新时间:2023-12-02 02:53:17 25 4
gpt4 key购买 nike

ImageButton 在其他布局中工作,但对于 TabLayout 不起作用。我尝试用 CardView 覆盖我的按钮,但没有帮助。

<RelativeLayout
android:id="@+id/rl_tab_container"
android:layout_width="match_parent"
android:layout_height="@dimen/standard_bar_height"
>

<android.support.design.widget.TabLayout
android:id="@+id/tabs_dict"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:tabGravity="center"
app:tabSelectedTextColor="@color/colorBlack87"
app:tabTextColor="@color/colorBlack54"
app:tabIndicatorColor="@color/colorBlack87"
android:background="@color/colorPrimary"
/>

<ImageButton
android:id="@+id/button_delete_all_curr_dict"
android:layout_width="48dp"
android:layout_height="48dp"
android:src="@drawable/ic_delete"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginEnd="8dp"
android:background="?attr/selectableItemBackgroundBorderless"
/>
</RelativeLayout>

最佳答案

在您的 ImageButton 上尝试一下

android:clickable="true"
android:foreground="?attr/selectableItemBackground"

关于java - 无法使用TabLayout在RelativeLayout中的ImageButton上获得链式 react ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43468020/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com