显示在列表视图耐磨超过3项以上不滚动 [英] Show more than 3 item in a wearable listview without scrolling

查看:162
本文介绍了显示在列表视图耐磨超过3项以上不滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个可穿戴列表视图,可以同时显示3个以上的项目,但耐磨列表视图只显示3项,我需要向下滚动看到其他项目。这是一个WearableListView具体的事情?

所以,我WearableListView是这样的:

WearableListView

但我想不滚动显示超过3项,因为它有足够的空间。

ListView控件容器的xml:

 < LinearLayout中的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
机器人:layout_width =match_parent
机器人:layout_height =match_parent
机器人:背景=@绘制/ kaempewatch_screen_bg
机器人:方向=垂直>< android.support.wearable.view.WearableListView
    机器人:ID =@ + ID / exercise_listview
    机器人:layout_width =match_parent
    机器人:layout_height =match_parent/>< / LinearLayout中>

该项目的xml:

 < LinearLayout中的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    机器人:layout_width =match_parent
    机器人:layout_height =WRAP_CONTENT
    机器人:方向=垂直
    机器人:paddingLeft =40dp
    机器人:paddingRight =40dp><的TextView
    机器人:ID =@ + ID / li_tv_training_name
    机器人:layout_width =match_parent
    机器人:layout_height =WRAP_CONTENT
    机器人:文字=新文本
    机器人:行=1
    机器人:ellipsize =金字招牌
    机器人:marqueeRepeatLimit =marquee_forever
    机器人:文字颜色=@色/白
    机器人:TEXTSIZE =16SP/><的TextView
    机器人:ID =@ + ID / li_tv_training_duration
    机器人:layout_width =WRAP_CONTENT
    机器人:layout_height =WRAP_CONTENT
    机器人:背景=@绘制/ nr_bg
    机器人:文字颜色=@色/白
    机器人:TEXTSIZE =13SP/>< / LinearLayout中>


解决方案

磨损列表视图设计为只有3个项目给予适当的超大触控的目标,所以我不会建议试图在屏幕上添加更多的项目到任何东西这应该与互动。

如果你纯粹想有一个列表中显示的,可通过滚动然后用滚动视图里面一个TextView。如果你打算重新使用它了很多,你可以封装程序了与接入方式,以各行的自定义窗口小部件。

I want to create a wearable listview that can show more than 3 item simultaneously, but the wearable listview only shows 3 item, and i have to scroll down to see the other items. Is this a WearableListView specific thing?

So my WearableListView looks like this:

But i want to show more than 3 item without scrolling, because it has enough space.

The listview container xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/kaempewatch_screen_bg"
android:orientation="vertical">

<android.support.wearable.view.WearableListView
    android:id="@+id/exercise_listview"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

</LinearLayout>

The item xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:paddingLeft="40dp"
    android:paddingRight="40dp">

<TextView
    android:id="@+id/li_tv_training_name"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="New Text"
    android:lines="1"
    android:ellipsize="marquee"
    android:marqueeRepeatLimit="marquee_forever"
    android:textColor="@color/white"
    android:textSize="16sp"/>

<TextView
    android:id="@+id/li_tv_training_duration"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/nr_bg"
    android:textColor="@color/white"
    android:textSize="13sp"/>

</LinearLayout>

解决方案

The Wear listview is designed to only have 3 items to give a suitably large touch target so I wouldn't recommend trying to add more items on the screen to anything that should be interacted with.

If you purely want to have a list displayed that can be scrolled through then use a textview inside a scrollview. You could wrapper this up into a custom widget with access methods to individual lines if you're going to re-use it a lot.

这篇关于显示在列表视图耐磨超过3项以上不滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆