我正在使用 google play 服务创建一个游戏。当玩家等待连接到其他人时,他们在等候室 UI 中,如下所示:
正如你所看到的,默认的候诊室 UI 非常基本,在视觉上完全不适合我的游戏主题。我想更改该 UI 中不同元素的背景,但布局的定义不会暴露在我能看到的任何地方。有没有办法编辑候诊室的布局?
我使用的代码从他们的示例应用程序“ButtonClicker2000”在这里找到:https://github.com/playgameservices/android-basic-samples
显示等候室的方法在这里:
// Show the waiting room UI to track the progress of other players as they enter the
// room and get connected.
void showWaitingRoom(Room room) {
// minimum number of players required for our game
// For simplicity, we require everyone to join the game before we start it
// (this is signaled by Integer.MAX_VALUE).
final int MIN_PLAYERS = Integer.MAX_VALUE;
Intent i = Games.RealTimeMultiplayer.getWaitingRoomIntent(mGoogleApi, room, MIN_PLAYERS);
// show waiting room UI
startActivityForResult(i, RC_WAITING_ROOM);
}
需要在 xml 文件中使用 android:background
for color:android:background="@color/white"
for img:android:background="@drawable/background"
本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处
评论列表(5条)