项目问题总结
来源:互联网 发布:找谱子的软件 编辑:程序博客网 时间:2024/06/05 16:30
在Android 7.0上PopupWindow.showAsDropDown不起作用的解决方法
public void show(View view) { if (Build.VERSION.SDK_INT == 24) { Rect rect = new Rect(); view.getGlobalVisibleRect(rect); int h = view.getResources().getDisplayMetrics().heightPixels - rect.bottom; setHeight(h); } showAsDropDown(view, 0, 0);}
Error:(16, 34) No resource found that matches the given name (at ‘layout_toLeftOf’ with value ‘@id/q
android:layout_toLeftOf里的id的控件要写在此id的前面
Parcelable encountered IOException writing serializable object
Intent intent = new Intent(LoginActivity.this, MainActivity.class);
intent.putExtra(“login”, loginModel);
startActivity(intent);
LoginModel类中的每个内部类都要事先Serializable接口
Unable to inflate view tag without class attribute
把<View />
写成<view />
了
Tablayout+ViewPager切换不相邻fragment时,总是重新onCreate
mViewPager.setOffscreenPageLimit(2);
SearchView改变光标、文字颜色
//searchview 文字颜色SearchView.SearchAutoComplete textView = (SearchView.SearchAutoComplete) searchview.findViewById(R.id.search_src_text);textView.setTextColor(Color.WHITE);//searchview 光标try {Class cls = Class.forName("android.support.v7.widget.SearchView");Field field = cls.getDeclaredField("mSearchSrcTextView");field.setAccessible(true);TextView tv = (TextView) field.get(searchview);Class[] clses = cls.getDeclaredClasses();for (Class cls_ : clses) { Log.e("TAG", cls_.toString()); if (cls_.toString().endsWith("android.support.v7.widget.SearchView$SearchAutoComplete")) { Class targetCls = cls_.getSuperclass().getSuperclass().getSuperclass().getSuperclass(); Field cuosorIconField = targetCls.getDeclaredField("mCursorDrawableRes"); cuosorIconField.setAccessible(true); cuosorIconField.set(tv, R.drawable.cursor); }}//下划线Field ownField = searchview.getClass().getDeclaredField("mSearchPlate");ownField.setAccessible(true);View mView = (View) ownField.get(searchview);mView.setBackgroundColor(Color.TRANSPARENT);
判断SearchView是否在搜索状态/展开状态
isIconified():
Returns the current iconified state of the SearchView. @return true if the SearchView is currently iconified, false if the search field is fully visible. svSearch.onActionViewCollapsed();
收起搜索栏
ProgressDialog的dismiss和cancle方法不起作用
dialog.show(this, "", "message");
使用dismiss和cancle关不了,因为它创建了一个新的dialog。
/** * Creates and shows a ProgressDialog. * * @param context the parent context * @param title the title text for the dialog's window * @param message the text to be displayed in the dialog * @return the ProgressDialog */ public static ProgressDialog show(Context context, CharSequence title, CharSequence message) { return show(context, title, message, false); }//正确用法dialog = new ProgressDialog(this);dialog.setMessage("请稍后...");dialog.show();dialog.dismiss();//或者dialog = ProgressDialog.show(this, "", "message")
阅读全文
0 0
- jboss项目问题总结
- 项目中小问题总结
- 项目问题总结
- 项目问题总结
- 项目问题总结
- 项目中问题总结
- 项目中问题总结:
- 项目部署问题总结
- 项目问题总结
- 项目中问题总结
- 项目安全性问题总结
- 项目问题总结
- 项目上线问题总结
- 项目测试问题总结
- SpringCloud项目问题总结
- 项目问题总结
- 项目运维问题总结
- 项目总结-SpringMVC细节问题
- Java设计模式学习—适配器模式
- 13.Linux进程控制编程
- 14.Python入门之异常处理
- Codeforces Round #449 (Div. 1) E. Welcome home, Chtholly
- Matlab R2008a破解
- 项目问题总结
- The Suspects POJ
- Flask--Javascript订阅多个主题
- HDFS:NameNode概述,DataNode 概述
- bizer 贝塞尔曲线
- 将COIL数据集从.png转换成.mat
- JAVA | 57
- Day_1
- Containerd迎来1.0通用版本