解决问题记录

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wfs31415926/article/details/52357070

鸿洋大神: 选择做正确的一件事,并且坚持下去。


本周待解决问题:
1.retrofict框架,Demo
2.indacator原理
3.汽车之家中的车型比对, 其中已加入参与比对的车型还有似乎***多余的车型加入比对***的***选择界面***就是为了整理列向的数据而存在的.不然很难实现,很难直接实现从选中车型到pk界面的在listView中一列一列的填充数据.( 为了能直接实现,需要将整个布局转过来,直接将列作为横向ListView的item而存在,这样方便数据的增删,而不用将javabean中的横向填充的数据转到列的方向上来填充) 加油~~~~ (10.13)
4.FramLayout中,即便Button定义在前面,TextView定义在后面,但是Button还是会压住TextView.谁能告诉我为什么?
博客预告:
1.EventBus3.0的使用,一处发送多处接收(普通的post发送消息和postSticky发送消息的区别.)(10.19) (10.26写毕)
2.高德sdk 地图展示在项目中地图无法初始化的问题. ,与arm版本有关系 (10.27)

注意的问题:
1.在xml文件中更改了布局后,有时只有clean project 之后再运行,才能出现新添加的布局LinearLayout 是咋回事? 待捣鼓清楚
2.从下方弹出的popWindow中的Edit唤醒的软件盘要把popWindow往上顶. 设置的正确方式:
//设置不被软键盘遮挡
popupWindow.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
//PopupWindow.INPUT_METHOD_NEEDED ()里写成这样只会把EditText顶出去.下面的button还是会被软键盘覆盖~
3.改变EditText的光标颜色,使用color不起作用时,直接用图片替代可以解决~android:textCursorDrawable="@drawable/shape_edittext_cursor"
4.(已解决)
ScrollView中有动态加载数据的ListView和GridView时.进入时会看到的不是头部.解决方法是:
将所有的其他要花费时间填充数据的部分都设置为不能获取到焦点.在setAdapter之前设置
listView.setFocued(false);
参考博客: https://segmentfault.com/q/1010000003101283

5.(已解决)
自定义ProgressBar的animation_list导致的图片变形问题 通过更改animation_list中的item可以解决:
例如:

<animation-list android:oneshot="false"
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:duration="150" android:drawable="@drawable/loading_01" />	
<item android:duration="150" android:drawable="@drawable/loading_02" />	
<item android:duration="150" android:drawable="@drawable/loading_03" />	
<item android:duration="150" android:drawable="@drawable/loading_04" />	
<item android:duration="150" android:drawable="@drawable/loading_05" />	
<item android:duration="150" android:drawable="@drawable/loading_06" />	
<item android:duration="150" android:drawable="@drawable/loading_07" />
</animation-list>
更改为:
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"    android:variablePadding = "true">	
<item android:duration="150">	    
<clip xmlns:android="http://schemas.android.com/apk/res/android"	        android:clipOrientation="horizontal"	        android:drawable="@drawable/loading_01"	        
android:gravity="left">	    
</clip>	</item>	
<item android:duration="150">	    
<clip xmlns:android="http://schemas.android.com/apk/res/android"	        android:clipOrientation="horizontal"	        android:drawable="@drawable/loading_02"	        
android:gravity="left">	    
</clip>	
</item>
</animation-list>

别问我为什么解决了,我也不知道~~~
参考博客地址: http://www.th7.cn/Program/Android/201505/449107.shtml
然后发现:上面的对API版本还是有限制。最后使用下面的解决方案
解决方案:
最后参考了自定义的View加上dialog来适配机型~

6.关于华为机型在 调用拨号界面拨打电话ACTION_DIAL时 (此时不用申请权限),会将带有分机号的400电话的分机号截断掉,无法自动拨打分机号。
解决方案:
需要采用dialog提示的方式,调用直接拨打电话的Intent ACTION_CALL来处理。 (需要申请权限,会涉及android 6.0以上的权限管理问题) 能处理好华为机型上面分机号被截取的问题 (17.1.10)

7.关于LinearLayout 布局只对 OnTouch监听响应 ACTION_DOWN 事件。不响应ACTION_MOVE 和ACTION_UP 事件
解决方案 :
在xml中 给 LinearLayout 将onLongClickable属性设置为true 。 将 OnToucch 的返回值设置为 true 为false好像也没什么影响,没看出来~ (解决) 170112

8.华为荣耀6 4.4.2 红米手机4.4.4打开应用闪退,爆java.lang.NoClassDefFoundError: org.xutils.common.task.TaskControllerImpl,定位在application的xutils3的初始化上面,其他5.0+的手机打开正常,请问有人遇到嘛
xutils3初始化语句 x.Ext.init(this);

解决:
原因:碰上65535问题之后,解决分包问题之后,导致的。
解决方案:这个问题解决了,我产生此问题的原型是由于在android stuido 中进行了分包的处理,分包处理后把项目application继承的父类改为MultiDexApplication 即可。
参看:安卓xutil3初始化错误 http://ask.csdn.net/questions/261912

9.Android如何让软键盘出现和消失
在程序中加入以下代码时,软键盘会出现:

InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
imm.toggleSoftInput(0, InputMethodManager.RESULT_SHOWN);
如果要让软键盘消失,则为以下代码:

InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);

imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
经验证有效(20170227)
软键盘的显示和隐藏
终极解决方案 http://blog.csdn.net/ccpat/article/details/46717573

10.仪器引导页在华为机型,魅族(含有虚拟按键的)上和普通的小米,三星手机上。全屏的引导页图片被压缩的问题。 在往ViewPager中填充图片时。需要将图片填充方式设置为setImageResource(),并通过设置填充方式进行裁剪处理~

      imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
      imageView.setImageResource(imgIdArray[position]);
//    imageView.setBackgroundResource(imgIdArray[position]);   //存在图片被在有虚拟按键的机型上图片被挤压变形的问题 
                       (解决 2070308)

11 . 各类型的AlertDialog
//显示自定义的Dialog
new AlertDialog.Builder(CourseSignupActivity.this).setTitle(“复选框”).setMultiChoiceItems(
new String[] { “Item1”, “Item2”,“Item3”,“Item4”,“Item5”,“Item6”,
“Item7”,“Item8”,“Item1”, “Item2”,“Item3”,“Item4”,“Item5”,“Item6”,“Item7”,“Item8” }, null, null)
.setPositiveButton(“确定”, null)
.show();

  1. 从gitHub上下载的项目 修改相应文件 快速编译
    参考: http://blog.csdn.net/zhouhui520w/article/details/52278814

原因: 下载的项目和你当前已经下载的grandle 不一致, 导致导入的时候到网上下载相应的版本。
解决办法:
1.翻墙下载,网速好的公司可以考虑。(毕竟原版的出问题的情况少)
2.修改需要导入的项目的配置

  1. xxx-project/.idea/gradle.xml 中的
  2. xxx-project/gradle/warpper/gradle-wrapper.properties 中的 distributionUrl=https://services.gradle.org/distributions/gradle-2.10-all.zip
    3.xxx-project/build.gradle 中的 classpath ‘com.android.tools.build:gradle:2.1.0’

13.要让ScrollView/或NetsedScrollView内部元素的 match_parent起作用必须设置android:fillViewport=“true”

14 CoordinatorLayout 中的Viewpager要触发 appBarLayout中的子布局跟随滚动. 将Viewpager添加到NetsedScrollView中,添加 android:fillViewport="true" app:layout_behavior="@string/appbar_scrolling_view_behavior 其中appBarLayout的滚动的布局要添加 app:layout_scrollFlags="scroll|enterAlways"
15 微信支付 加入加密时 确保待加密码 不要有前后误带的空格 ,千万注意 被这玩意卡了一天
16 android 适配 dp适配
https://www.jianshu.com/p/1302ad5a4b04
17 setTextSize的使用单位
https://www.jianshu.com/p/7f2941dbfb17
示例:
viewHolder.nameTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 15);
18. 解决Android Studio编译后安装apk报错:Error while Installing APK
参照:
https://blog.csdn.net/qq_36525622/article/details/78996791
19.在约束布局中使用include标签报错
解决方案:给include布局设置宽高
参考:https://blog.csdn.net/Ein3614/article/details/81210399

猜你喜欢

转载自blog.csdn.net/wfs31415926/article/details/52357070
今日推荐