我目前正在制作一个程序,该程序应该提示用户选择要连接的某个蓝牙设备。我通过选项菜单在我的代码中设置了它。
我希望它看起来像 BlueTerm 的弹出窗口。我实际上有 BlueTerm 的代码(因为它可以免费查看),但我不知道如何使窗口显示为弹出窗口而不是全屏视图。这是弹出窗口图片的链接:
是在xml文件中完成的吗?因为我找不到我的 XML 文件与他们的 XML 文件之间的差异,这会导致此错误。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:id="@+id/title_paired_devices"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/title_paired_devices"
android:visibility="gone"
android:background="#666"
android:textColor="#fff"
android:paddingLeft="5dp" />
<ListView android:id="@+id/paired_devices"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:stackFromBottom="true"
android:layout_weight="1" />
<TextView android:id="@+id/title_new_devices" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/title_other_devices" android:visibility="gone" android:background="#666" android:textColor="#fff" android:paddingLeft="5dp" />
<ListView android:id="@+id/new_devices" android:layout_width="fill_parent" android:layout_height="wrap_content" android:stackFromBottom="true" android:layout_weight="2" />
<Button android:id="@+id/button_scan" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/button_scan" />
</LinearLayout>
您必须将该活动的主题定义为 AndroidManifest.xml 文件中的 Theme.Dialog
Example:
<activity android:name="AleartMeassage" android:theme="@android:style/Theme.Dialog"></activity>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)