CSDN | 简书 | 掘金 | 公众号 |
---|---|---|---|
点击这里 | 点击这里 | 点击这里 | 点击这里 |
yixiaolunhui / androidmarqueeview Goto Github PK
View Code? Open in Web Editor NEW跑马灯
跑马灯
增加点击事件
我把该控件给隐藏了,结果调用了view.Visiable的时候显示不出来,缩小到后台,然后再进去的时候又能重新显示,搞不懂
速度设置没有用,而且加载页面的时候好卡,需要的时间太长
滑动的过程中,有一卡一卡的感觉,流畅度是否可以提升呢?
BaseLine的Y坐标如果这样计算centeYLine + dip2px(getContext(), textHeight) / 2 会导致问题偏上一点点.
应该这样计算 centeYLine + ((fontMetrics.bottom - fontMetrics.top) / 2 - fontMetrics.bottom)
<com.dalong.marqueeview.MarqueeView
android:id="@+id/tv_share"
android:layout_width="fill_parent"
android:layout_height="144px"
app:direction="left"
app:isRepeat="true"
app:speed="5"
app:startPoint="start"
app:textSize="18dp"
app:textcolor="@color/colorWhite" />
问题1:app:speed="X"设置为任何数值实际速度都是一样的。
问题2:在不同分辨率上滚动速度不同,分辨率越低,滚动速度越快。这个应该是因为您设置的速度值为px,没有做dp适配。
问题3:在popupwindow中不能正常使用,连文字都不能显示。
希望能改一下。
1.The scrolling text will overwrite before the active jump and keep returning to the foreground
,在活动跳转以及不断返回前台的过程中,正在滚动的textview会覆盖之前的textview
java.lang.OutOfMemoryError: Failed to allocate a 4941016 byte allocation with 4140292 free bytes and 3MB until OOM
at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:95)
at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:146)
at java.lang.StringBuilder.append(StringBuilder.java:216)
at com.demo.demo.view.MarqueeView.onDraw(MarqueeView.java:176)
at android.view.View.draw(View.java:15253)
at android.view.View.updateDisplayListIfDirty(View.java:14189)
at android.view.View.getDisplayList(View.java:14211)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
at android.view.View.updateDisplayListIfDirty(View.java:14149)
at android.view.View.getDisplayList(View.java:14211)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
at android.view.View.updateDisplayListIfDirty(View.java:14149)
at android.view.View.getDisplayList(View.java:14211)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
at android.view.View.updateDisplayListIfDirty(View.java:14149)
at android.view.View.getDisplayList(View.java:14211)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
at android.view.View.updateDisplayListIfDirty(View.java:14149)
at android.view.View.getDisplayList(View.java:14211)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
at android.view.View.updateDisplayListIfDirty(View.java:14149)
at android.view.View.getDisplayList(View.java:14211)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
at android.view.View.updateDisplayListIfDirty(View.java:14149)
at android.view.View.getDisplayList(View.java:14211)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:273)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:279)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:318)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2580)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2402)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2032)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5971)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
at android.view.Choreographer.doCallbacks(Choreographer.java:580)
at android.view.Choreographer.doFrame(Choreographer.java:550)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5258)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:963)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:758)
可以设置背景图片吗
异常内容如下:
01-18 17:13:38.393 21815-6305/com.kingbird.advertisting E/SurfaceHolder: Exception locking surface
java.lang.IllegalArgumentException
at android.view.Surface.nativeLockCanvas(Native Method)
at android.view.Surface.lockCanvas(Surface.java:452)
at android.view.SurfaceView$4.internalLockCanvas(SurfaceView.java:903)
at android.view.SurfaceView$4.lockCanvas(SurfaceView.java:879)
at com.dalong.marqueeview.MarqueeView$MarqueeViewThread.onDraw(MarqueeView.java:171)
at com.dalong.marqueeview.MarqueeView$MarqueeViewThread.run(MarqueeView.java:225)
这些异常会导致什么后果呢?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.