开发者

android custom view for notification

i want to add a view in my application which has to be clickable, i've tried a dialog but it block 开发者_如何学编程the execution of the game, i've also tried to add a view to the WindowManager but it's not clickable. How can i create a "banner like" view?


In my understanding, you want to have a banner view floating above your game view. Try using FrameLayout. Following is a sample xml, hope it can help:

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent" android:layout_height="fill_parent">
    <!-- Replace this with your banner -->
    <ImageView android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:src="@drawable/icon"/>
    <TextView android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:text="Replace this with your game view"/>
</FrameLayout>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜