Linearlayout.setvisibility(View.ibible)导致滞后Android应用程序



当用户单击地图上的标记时,我正在尝试使线性布局可见,但是每次用户单击它,应用程序都会放慢,几秒钟后,它崩溃了,我怎么解决这个问题?那是我想使可见的线性布局:

 <LinearLayout
                        android:id="@+id/group"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:orientation="horizontal"
                        android:background="#80000000">
                        <LinearLayout
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight="7"
                            android:orientation="vertical">
                            <LinearLayout
                                android:layout_width="match_parent"
                                android:layout_height="0dp"
                                android:layout_weight="1">
                                <TextView
                                    android:id="@+id/addresse"
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent" />
                            </LinearLayout>
                          <LinearLayout
                              android:layout_width="match_parent"
                              android:layout_height="0dp"
                              android:layout_weight="1">
                              <TextView
                                  android:layout_width="0dp"
                                  android:layout_height="match_parent"
                                  android:text="gelmj"
                                  android:textColor="@color/white"
                                  android:background="@color/black"
                                  android:layout_weight="1"
                                  />
                              <TextView
                                  android:layout_width="0dp"
                                  android:layout_height="match_parent"
                                  android:text="gelmkhj"
                                  android:textColor="@color/black"
                                  android:background="@color/white"
                                  android:layout_weight="1"/>
                          </LinearLayout>
                        </LinearLayout>
                        <LinearLayout
                            android:background="@color/red"
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight="3">
                            <ImageView
                                android:src="@drawable/parking"
                                android:layout_width="match_parent"
                                android:layout_height="match_parent" />
                        </LinearLayout>
                    </LinearLayout>

谢谢。

,很难猜测没有代码和错误日志的问题,但是在大多数情况下,当您尝试将高分辨率图像加载在具有低内存的手机上时,滞后是造成的,而且,如果内存完整,就会引发一个外观异常,从而导致应用程序崩溃。尝试减少图像视图中图像的大小,也可以增加分配给应用程序的内存堆:在清单中,将属性添加到应用程序标签:Android:grineHeap =" true"

最新更新