2016-10-04 36 views
4

我開始製作可穿戴應用程序,並且我可以在我的MainActivity中看到WatchViewStub已被棄用。我在網上搜索我應該使用什麼,而不是WatchViewStub,但我找不到任何東西。我使用support:wearable:2.0.0-alpha3'。任何人都可以幫忙?WatchViewStub已過時

謝謝!

+1

你可能要檢查這個[博客](https://sterlingudell.wordpress.com/category/wearables/),它會告訴用'WatchViewStub'一種解決方法。你可以嘗試['onApplyWindowInsets'](https://developer.android.com/training/wearables/watch-faces/issues.html#ScreenShape),它可以很容易地獲得那裏的屏幕形狀 - 並相應地擴大適當的佈局。另外,你可以檢查這個[git](https://gist.github.com/tajchert/a49c22f54962bd9005bc)代碼實現目的。此git顯示Android Wear設備上的屏幕形狀檢測。希望這可以幫助! –

回答