![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
自定义view
perfectnihil
java,dart,python,js,lua
展开
-
Android自定义View(二) 画圆角线
自定义view时画一个线段很简单,那么如果想要画一个两端圆润的线段要怎么操作呢?@Overrideprotected void onDraw(Canvas canvas) { super.onDraw(canvas); mPaint.setStrokeWidth(30); mPaint.setStrokeCap(Paint.Cap.ROUND);原创 2017-09-26 15:59:09 · 10460 阅读 · 1 评论 -
Notification 的 TransactionTooLargeException的问题
最近做一个需求,需要每隔五秒更新通知栏的ui,考虑的性能问题,notification不是每次都new然后再后台发现报了如下问题: android.os.TransactionTooLargeException at android.os.BinderP原创 2017-11-27 16:33:13 · 1349 阅读 · 0 评论 -
Android Notification(一) Notification 的 requestCode 与 id
Notification notification1 = builder .setContentIntent(PendingIntent.getActivity(this,(int)System.currentTimeMillis(),intentTest,0)) .setSmallIcon(R.drawable.ic_launcher)原创 2017-11-21 20:22:29 · 1157 阅读 · 0 评论 -
如何在小米,oppo r9 等国产手机上突破通知栏高度限制
最近在针对一个推送的需求做开发,需要推送一个多行展示的新闻。在我自己的手机上是没问题,但是在一些国产手机上,如小米,oppo上则怎么也无法多行展示。====================================================================最后的结论是:突破不了的,改需求吧!原创 2017-11-21 19:33:47 · 2769 阅读 · 1 评论 -
Couldn't expand RemoteViews 错误及解决
在写通知栏的时候遇到如下错误android.app.RemoteServiceException: Bad notification posted from package com.cootek.smartdialer: Couldn't expand RemoteViews 原因:使用了自定义控件com.makeramen.roundedimageview.Rou原创 2017-11-14 10:59:24 · 2912 阅读 · 0 评论 -
Android PopupWindow用法(五) showAtLocation
popupwindow 的 showAsDropDown 比较鸡肋开发中用的比较多的是showAtLocationSection1 Gravity/** * * Display the content view in a popup window at the specified location. If the popup window *原创 2017-11-01 17:02:08 · 997 阅读 · 0 评论 -
dialog 与statusbar
最近在使用 Android 开发的过程中遇到一个测试提的所谓bug因为当前界面是全屏的当dialog出来时,会发现statusbar也随着出来了导致界面整体下沉=============================================================解决方案dialog. getWindow().setFlags(WindowM原创 2017-11-01 10:54:48 · 1697 阅读 · 0 评论 -
getViewTypeCount 与 addScrapView 的crash
报错如下:E/CrashReport: java.lang.ArrayIndexOutOfBoundsException: length=6; index=6 at android.widget.AbsListView$Recycle原创 2017-11-07 17:41:45 · 301 阅读 · 0 评论 -
Android PopupWindow用法(三) PopupWindow 的show方法
Section1popupWindow.showAsDropDown(tv_bottom_b);popupWindow.showAsDropDown(tv_bottom_b,100,100);popupWindow.showAsDropDown(tv_bottom_b,100,100, Gravity.RIGHT|Gravity.TOP);第一个方法 showAsDrop原创 2017-09-26 19:44:09 · 2193 阅读 · 0 评论 -
MeasureSpecMode 的三个值都是什么意思?
Section1查看View源码中的/** * Extracts the mode from the supplied measure specification. * * @param measureSpec the measure specification to extract the mode from * @return {@link android.view.Vie原创 2017-09-26 18:13:54 · 780 阅读 · 0 评论 -
Android PopupWindow用法(二)_showAsDropDown 方法显示的位置
看源码里面的注释/** * Display the content view in a popup window anchored to the bottom-left * corner of the anchor view. If there is not enough room on screen to show * the popup in its entirety, this met原创 2017-09-26 17:04:47 · 722 阅读 · 0 评论 -
Android自定义View(一) 画线段
public class MusiceView extends View { Paint mPaint; public MusiceView(Context context) { super(context); mPaint = new Paint(); mPaint.setColor(getResources().getColor(an原创 2017-09-04 11:42:47 · 2705 阅读 · 0 评论 -
Notification使用误区
Updating notificationsTo set up a notification so it can be updated, issue it with a notification ID by calling NotificationManager.notify(). To update this notification after you've issued原创 2017-11-27 18:00:13 · 668 阅读 · 0 评论