There is a layout
<LinearLayout android:id="@+id/layout" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:layout_marginTop="10dp" android:background="@drawable/background"> </LinearLayout> which is inside RelativeLayout , this RelativeLayout is inside ScrollView . I programmatically create components in this leyaut. Components are different ( TextView , EditText , Spinner , etc.). This layer has a background (a simple background with rounded edges and a 1dp stroke). On the emulator, everything works fine, there are no lags. But it is necessary to throw apk on the device, as there are 2 problems:
- If there are a lot of components (more than 20), then for some reason the background disappears. Ie it generally seemed not to be.
- If there are not many components (less than 20) - the background is there, but it lags terribly when scrolling. Strongly freezes. It is worth adding a few components - as the background disappears and nothing lags.
Why it happens? thank