欢迎访问悦橙教程(wld5.com),关注java教程。悦橙教程  java问答|  每日更新
页面导航 : > > 文章正文

采用发射机制改变滑动块的素材,发射机制滑动素材,try { Fi

来源: javaer 分享于  点击 36148 次 点评:157

采用发射机制改变滑动块的素材,发射机制滑动素材,try { Fi


try {     Field f = AbsListView.class.getDeclaredField("mFastScroller");     f.setAccessible(true);     Object o=f.get(mTrackListView);     Class<?> fastClass = f.getType();    f=fastClass.getDeclaredField("mThumbDrawable");     f.setAccessible(true);     Drawable drawable=(Drawable) f.get(o);     drawable=getResources().getDrawable(R.drawable.clock_background);    f.set(o,drawable);     f = fastClass.getDeclaredField("mThumbW");    f.setAccessible(true);     f.setInt(o, 160);    f = fastClass.getDeclaredField("mThumbH");    f.setAccessible(true);     f.setInt(o, 70);} catch (Exception e) {     throw new RuntimeException(e); }//该片段来自于http://byrx.net
相关栏目:

用户点评