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)
提前致谢
我想获取我单击的项目的位置。
请给我同样的建议。
我已经实现了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