Home > Mobile >  Too much help ImageView loading screen will flash pictures
Too much help ImageView loading screen will flash pictures

Time:03-06




ImageView will flash when too much load pictures

Code is very simple to create a new project directly thrown on the XML below don't have to add other code

 & lt; ? The XML version="1.0" encoding="utf-8"?> 
Android: layout_width="match_parent"
Android: layout_height="match_parent"
Android: orientation="vertical" & gt;


The android: id="@ + id/my_toolbar"
Android: layout_width="match_parent"
Android: layout_height="120 dp"
Android: layout_margin="16 dp"
The android: SRC="https://bbs.csdn.net/topics/#FFA382"/& gt;

XMLNS: android="http://schemas.android.com/apk/res/android"
Android: layout_width="match_parent"
Android: layout_height="wrap_content"
Android: orientation="vertical"
Android: layout_weight="1"


Android: layout_width="match_parent"
Android: layout_height="wrap_content"
Android: orientation="vertical" & gt;

The android: id="@ + id/id_glide_image"
Android: layout_width="match_parent"
Android: layout_height="wrap_content"
Android: adjustViewBounds="true"
Android: layout_margin="16 dp"
Android: background="@ drawable/big_image"/& gt;







Layout is simple

Just put a scrollview image view is used to load a larger image (and not just 800 x800), and then rolling scrollview can see my_toolbar will flash

Model red rice

Do anyone know why?

CodePudding user response:

Try glid

CodePudding user response:

Look the pictures pictures of local resources, don't do any processing, and resource directory of images with the current produced under the same ratio of the phone's screen is 2 MB of memory (800 * 800 * 4),

If you place the folder corresponding screen resolution is lower than the current mobile phone, so will conduct a amplifier,

Related calculation can refer to this article at https://blog.csdn.net/stven_king/article/details/105677102
  • Related