我试图在一个xml文件中使用两个自定义标记,但其中任何一个都在调用,我想同时显示这两个标记。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000000"
android:orientation="vertical" >
<com.example.android.animations.SecondballView
android:id="@+id/second_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
<com.example.android.animations.AnimatedView
android:id="@+id/anim_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
如果有人想要任何进一步的代码或片段,请告诉我。提前谢谢。
您的第一个视图设置为match_parent,因此它将第二个视图推出屏幕。将其设置为wrap_content或layout_height="0dp",并改为layout_weight="1"。