【问题标题】:Add marquee textview to google infowindow in android?将选取框文本视图添加到 android 中的谷歌信息窗口?
【发布时间】:2016-08-29 09:13:47
【问题描述】:

我在自定义的谷歌信息窗口中有一个 Textview。

在文本视图中添加选取框

          <TextView
            android:id="@+id/scroll"
            android:text="Single-line text view that scrolls automatically if the text is too long to fit in the widget"
            android:singleLine="true"
            android:ellipsize="marquee"
            android:marqueeRepeatLimit ="marquee_forever"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:scrollHorizontally="true"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

还添加了 setSelected 来滚动。

 View v = LayoutInflater.from( getActivity() ).inflate( R.layout.view_info_window, null );
TextView scroll = (TextView) v.findViewById( R.id.scroll );
            scroll.setSelected(true);

但文本没有在信息窗口中滚动。请帮忙

【问题讨论】:

    标签: android google-maps infowindow


    【解决方案1】:

    您必须以编程方式添加 selected true 。

    textview.SetSelected(true)
    

    更新

    谷歌信息窗口在非实时视图中,因此您无法实现您想要实现的目标。

    【讨论】:

    • 我也添加了该部分,但有些它在 infowindow 中不起作用..marquee 在正常布局中为 textview 工作
    • 哦,谷歌信息窗口不是实时视图,因此您无法实现您想要实现的目标。 @user9213
    • 我还有其他方法可以做到吗?
    • 检查这个答案stackoverflow.com/questions/14123243/…。不过有点难。 @user9213
    猜你喜欢
    • 2018-06-05
    • 1970-01-01
    • 1970-01-01
    • 2017-11-14
    • 1970-01-01
    • 2013-08-04
    • 2013-08-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多