1
进出口创造了谷歌电视的应用程序。我正尝试在广播顶部创建一个自定义的烤面包覆盖层。如何实现土司覆盖在谷歌电视
我已经创建的自定义敬酒如下:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/custom_toast_layout_id"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFF"
android:orientation="horizontal"
android:padding="5dp" >
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:textColor="#000" />
</LinearLayout>
,并在GoogleTV的应用程序的视图来实现它:
LayoutInflater inflater = getLayoutInflater();
View layout = inflater.inflate(R.layout.main,
(ViewGroup) findViewById(R.id.custom_toast_layout_id));
// Toast...
Toast toast = new Toast(getApplicationContext());
toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
toast.setDuration(Toast.LENGTH_LONG);
toast.setView(layout);
toast.show();
我的问题是如何使这个应用程序显示正常在应用程序中广播信息,以便在观看期间触发此覆盖图?
任何帮助非常感谢。
嗨感谢您的回答。我已经创建了应用程序,但我应该如何设置顶级线性布局的透明度?我试过android:background =“@ android:color/transparent”但仍显示黑色? “:windowIsTranslucent机器人”谢谢 – EHarpham 2013-03-23 16:17:33
与创建一个透明的风格。看看覆盖应用链接的确切样式。 – 2013-03-23 18:27:24