当前位置:网站首页>Development error notes
Development error notes
2022-07-05 05:09:00 【ximen502_】
development environment IDE
Android Studio Environmental error
- 1. Error prompt that the resource file referenced by the layout does not exist
Caused by: android.content.res.Resources$NotFoundException
Caused by: org.xmlpull.v1.XmlPullParserException:
Binary XML file line #8<gradient> tag requires 'angle' attribute to be a multiple of 45
There is one bg xml file , There is a gradient configuration gradient One of them angle Property is assigned to 128, When reporting an error , The main idea is angle The value of must be 45 Multiple , Changed , The problem is solved in an instant . This problem deserves in-depth analysis , Look at the source code related to error reporting , A little clearer .
- 2.R Resource access is red , But it does not affect the normal operation of the program
You cannot click to view the referenced resource file , Tried some online methods , Doesn't work , So it's upgraded as Version of ,from 4.2.2 to arctic fox, When the upgrade is complete R There is no problem with the resource file , You can click and jump normally , It's not red anymore .
However, there are new problems , That is, the layout file preview appears fuzzy and the constraint position display is inaccurate , It is accurate after operation , I wanted to be demoted to 4.x edition , Then I searched as Of archive Version history , Found an updated Bumblebee bumblebee preview beta1, So I upgraded , Temporarily solved the problem .
Android Coding errors
1.RecyclerView item xml Layout match_parent Level not full
The root layout uses ConstraintLayout and LinearLayout All have this problem , But with RelativeLayout There is no such problem . A search later found that , Originally in onCreateViewHolder Method inside inflate The layout will be methodical viewParent As inflate Methodical roo Parameters can completely solve this problem . Debugging found this viewParent yes RecyclerView.
2. The data format of the string array returned by the server
A picture returned by the server url Array json
{
imgs:"["http://xxx.jpg","http://xxy.jpg"]"
}
This situation is used in Gson go to Bean When ,Bean Medium imgs Can only be String type , Otherwise, the conversion will report an error , This situation gets imgs After the string , It also needs to be parsed manually , The picture url Add one by one to List In the container , A lot more redundant code , Very inelegant . The server needs to place ( Double quotes ) Get rid of ,
{
imgs:["http://xxx.jpg","http://xxy.jpg"]
}
such ,Bean Medium imgs Can be defined as List<String> or MutableList<String>, The conversion tool can be directly converted to carry url Of List Containers , Very elegant .
边栏推荐
- 2022/7/1学习总结
- GameObject class and transform class of unity
- 中国艾草行业研究与投资前景预测报告(2022版)
- PostgreSQL surpasses mysql, and the salary of "the best programming language in the world" is low
- Unity3d learning notes
- UE4/UE5 虚幻引擎,材质篇,纹理,Compression and Memory压缩和内存
- Cocos2dx screen adaptation
- Unity check whether the two objects have obstacles by ray
- AutoCAD - feature matching
- Animation
猜你喜欢

AutoCAD - command repetition, undo and redo

Embedded database development programming (VI) -- C API

小程序直播+电商,想做新零售电商就用它吧!

Use of snippets in vscode (code template)

Reverse one-way linked list of interview questions

Create a pyGame window with a blue background

Data is stored in the form of table

Chinese notes of unit particle system particle effect

AutoCAD - graphic input and output

Redis 排查大 key 的4种方法,优化必备
随机推荐
C # perspective following
cocos_ Lua loads the file generated by bmfont fnt
中国溶聚丁苯橡胶(SSBR)行业研究与预测报告(2022版)
Generate filled text and pictures
Recherche de mots pour leetcode (solution rétrospective)
Applet live + e-commerce, if you want to be a new retail e-commerce, use it!
Magnifying glass effect
Download and use of font icons
[paper notes] multi goal reinforcement learning: challenging robotics environments and request for research
Do a small pressure test with JMeter tool
Judge the position of the monster in the role under unity3d
Unity intelligent NPC production -- pre judgment walking (method 1)
Use assimp library to read MTL file data
Database under unity
中国针状焦行业发展研究与投资价值报告(2022版)
Django reports an error when connecting to the database. What is the reason
中国聚氨酯硬泡市场调研与投资预测报告(2022版)
AutoCAD - full screen display
Redis has four methods for checking big keys, which are necessary for optimization
嵌入式数据库开发编程(零)