簡體   English   中英

如何更改Google Play連接彈出菜單的重力?

[英]How to change the gravity of the google play connection pop-up menu?

我正在Android上做一個小游戲應用程序。 我的主要活動是擴展BaseGameActivy,因此當我打開應用程序時它會自動連接到Google Play。 我正在嘗試在活動頂部顯示“正在連接”彈出菜單,但它不起作用。 谷歌文檔說

您可以使用setShowConnectingPopup()自定義登錄過程中Google Play游戲“正在連接”彈出窗口的顯示方式。

我在主要活動的“ onCreate”中嘗試了以下行:

Games.GamesOptions.builder().setShowConnectingPopup(true, Gravity.TOP);

但它仍然不起作用。

在為GoogleApiClient定義Builder()地方,您需要添加所需的Api並為該特定的Api定義所需的GoogleApiClient.ApiOptions (並且不要忘記調用build()方法)。 在您的情況下,您應該在onCreate()中執行以下操作

        GoogleApiClient.ApiOptions apiOptions = Games.GamesOptions.builder().setShowConnectingPopup(true, Gravity.TOP).build();
        GoogleApiClient googleApiClient = new GoogleApiClient.Builder(this)
            .addApi(Games.API, apiOptions)
            .build();

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM