2017-04-17 105 views

回答

1

使用boxinsetlayout

// android.support.wearable.view.BoxInsetLayout

应用:layout_box = “左|底部|右”

...你的列表视图和其他内容

android.support.wearable.view.BoxInsetLayout>

,如果你正在使用wearableRecyclerView 做CircularChildLayoutManager mChildLayoutManager = new CircularChildLayoutManager(mContext); 并将其设置为您的回收站视图的布局管理器。

mRecyclerView.setLayoutManager(mChildLayoutManager); 

这可能会为您解决。

+0

我已经使用BoxInsetLayout,并添加app:layout_box =“left | bottom | right”仍然无法正常工作。 –

+0

尝试应用程序:layout_box =“left | bottom | right | top”... –

+1

仍然无法正常工作。您确定这是它的工作原理吗? –

2

的API更名为CurvedChildLayoutManager

所以使用

val layoutManager = CurvedChildLayoutManager(this) 
recyclerView.layoutManager = layoutManager 

PS:作为话题的问题,你不需要app:layout_box只是你WearableRecyclerView

https://developer.android.com/reference/android/support/wearable/view/CurvedChildLayoutManager.html

+0

我无法解析CurvedChildLayoutManager类,你知道为什么吗?我的依赖关系是 依赖关系编译文件树(dir:'libs',include:['* .jar'])编译'com.google.android.support:wearable:2.0.0' compile'c​​om.google。 android.gms:play-services-wearable:10.2.1' 提供'com.google.android.wearable:wearable:2.0.0' } –

+0

@fangjack试试2.0.1 – deviant

+1

我更改为2.0.1,CurvedChildLayoutManager被导入。但使用CurvedChildLayoutManager不能正常工作,滚动条仍然是垂直的,而不是弯曲的。 –

0

实际使用android:scrollbars="vertical" ,滚动条对于任何滚动条都是圆形的e视图占据了整个屏幕。这是Wear 2.0的框架功能。

如果滚动条仍然是垂直的,请确保您的视图确实填满了整个屏幕 - 将其设置为match_parent并作为顶级根视图。