可见这是我在列表视图布局XML文件中的代码按钮在模拟器的ListView不可见的,虽然它是在渲染
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@android:id/empty"
android:text="No schedules available"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</TextView>
<ListView android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:drawSelectorOnTop="false"
android:layout_gravity="right|bottom"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<ImageButton
android:layout_width="89dp"
android:layout_height="56dp"
android:id="@+id/add_schedule"
android:layout_gravity="right"
android:src="@mipmap/ic_add_fab"
android:background="#00ffffff"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
按钮是在渲染器,但不是在我的模拟器可见。 Suggesstions会很有帮助 这整个设置是在一个主详细流程
做任何事情,我会建议在此之前,您在真实设备中检查您的代码,因为图形渲染器和模拟器中的外观可能会引起误解。作为一个便笺,您是否使用Android Studio? – drWisdom
是的,我正在使用android studio –
我认为你正在设置图像按钮作为浮动操作按钮(FAB)。在这种情况下,您可能会更好地使用官方FAB小部件,而不是创建自己的。这是完成作为 它会简化你的过程,并最大限度地减少奇怪的行为 –
drWisdom