大佬教程收集整理的这篇文章主要介绍了android蜂窝中的弹出/覆盖屏幕,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
XML:
<FrameLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1"> <fragment class="com@L_899_8@me.LOCATIOn.to.fragment" android:id="@+id/fragment" android:layout_width="match_parent" android:layout_height="match_parent" /> <LinearLayout android:id="@+id/overlay_pane" android:layout_width="match_parent" android:layout_height="match_parent" android:visibility="gone" android:BACkground="@color/transparent"> </LinearLayout> </FrameLayout>
然后在我的代码中的某个按钮上,我只是将一个View(在你的情况下它可以只是对话框的内容)添加到overlay_pane LinearLayout.
Java示例:
ViewGroup container = findViewById(R.id.overlay_panE); container.setVisibility(View.VISIBLE); container.addView(some_view_you_inflated);
但是这个膨胀的视图将具有以下背景:@ drawable / dialog_full_holo_light以获得像Honeycomb样式的漂亮边框效果.
您可以在以下文件夹中的SDK中找到可绘制的背景
所以只需将其复制到您的drawable中.
注意:您也可以使用dialog_full_holo_dark或任何自定义背景来获得相同的效果.
我希望有所帮助:)如果我在任何时候都不清楚,请告诉我
注意:您可以仅使用具有match_parent的LinearLayout而不是使用片段,而是使用layout_width和layout_height.然后你会用“背景”UI填充LinearLayout(在问题的例子中……那就是地图)
以上是大佬教程为你收集整理的android蜂窝中的弹出/覆盖屏幕全部内容,希望文章能够帮你解决android蜂窝中的弹出/覆盖屏幕所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。