自定义布局里子View的子View不显示

2025-05-19 20:55:52
推荐回答(1个)
回答1:

检查下是不是布局覆盖了,用的帧布局的话
android:id="@+id/my2048View"
android:background="@android:color/black"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">

android:id="@+id/button"
android:textColor="@android:color/white"
android:background="@mipmap/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />