小编Yog*_*ade的帖子

Android TextView Marquee无法正常工作

Marquee不适合我的TextView请检查下面的代码

XML代码TextView

                          <TextView
                            android:id="@+id/mtextcash"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_centerVertical="true"
                            android:layout_marginLeft="30dp"
                            android:ellipsize="marquee"
                            android:fadingEdge="horizontal"
                            android:gravity="center"
                            android:marqueeRepeatLimit="marquee_forever"
                            android:maxLength="5"
                            android:scrollHorizontally="true"
                            android:scrollbars="horizontal"
                            android:singleLine="true"
                            android:text="Simple application that shows how to use marquee, with a long text"
                            android:textColor="@color/white"
                            android:textColorHint="@color/white"
                            android:textSize="25dp" />
Run Code Online (Sandbox Code Playgroud)

在活动OnCreate中

TextView inputAvailableCash = (TextView) findViewById(R.id.mtextcash);
inputAvailableCash.setSelected(true);
Run Code Online (Sandbox Code Playgroud)

提前致谢

android marquee textview android-layout

5
推荐指数
2
解决办法
4793
查看次数

如何获取RecyclerView中触摸的Item行的位置

我想获取我单击的项目的位置。

请给我同样的建议。

我已经实现了ontouchItemListener这样的:

请参考下面的代码。

recyclerView.addOnItemTouchListener(new RecyclerView.OnItemTouchListener() {
    @Override
    public boolean onInterceptTouchEvent(RecyclerView rv, MotionEvent e) {
        return false;
    }

    @Override
    public void onTouchEvent(RecyclerView rv, MotionEvent e) {
    }

    @Override
    public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {

    }
});
Run Code Online (Sandbox Code Playgroud)

android position event-listener listviewitem android-recyclerview

0
推荐指数
1
解决办法
1438
查看次数