Tag Archives: linearlayout

4,338 views

Error android.widget.LinearLayout.measureHorizontal LinearLayout.java

Code with error: ImageView imgV = (ImageView)findViewById(R.id.myView); imgV.setLayoutParams(new ViewGroup.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, 0)); If you get error try this code: ViewGroup.LayoutParams layoutParams = imgV .getLayoutParams(); layoutParams.height = 0; imgV.setLayoutParams(layoutParams); java.lang.ClassCastException: android.view.ViewGroup$LayoutParams at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:659) at android.widget.LinearLayout.onMeasure(LinearLayout.java:311) at android.view.View.measure(View.java:8313) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3138) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1017) at … Continue reading

Posted in Android Examples Code, Bugs, warnings, errors | Tagged , , | Comments Off on Error android.widget.LinearLayout.measureHorizontal LinearLayout.java
18,376 views

HorizontalScrollView ScrollView horizontal vertical Android xml example

HorizontalScrollView ScrollView LinearLayout horizontal vertical Android xml basic example and image. <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:id="@+id/LinearLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android">   // horizontal and vertical Scrollview <ScrollView android:id="@+id/ScrollView01" android:layout_height="135px" android:layout_width="wrap_content" android:scrollbars="horizontal|vertical">   // HorizontalScrollview <HorizontalScrollView android:id="@+id/HorizontalScrollView01" android:layout_height="fill_parent" android:layout_width="wrap_content">   <LinearLayout android:id="@+id/LinearLayout02" … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on HorizontalScrollView ScrollView horizontal vertical Android xml example
40,028 views

Scroll to certain position on application Android example code

ScrollTo(), getTop(), getBottom(), getLeft(), getRight(), ScrollView, LinearLayout Android Java xml example. How get position of a View. MainClass.java /* public void scrollTo (int x, int y) Since: API Level 1 Set the scrolled position of your view. This will cause … Continue reading

Posted in Android Examples Code | Tagged , , , , , , , | Comments Off on Scroll to certain position on application Android example code