{"id":4310,"date":"2014-03-30T09:48:17","date_gmt":"2014-03-30T09:48:17","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/android-resize-an-horizontalscrollview-collection-of-common-programming-errors\/"},"modified":"2014-03-30T09:48:17","modified_gmt":"2014-03-30T09:48:17","slug":"android-resize-an-horizontalscrollview-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/android-resize-an-horizontalscrollview-collection-of-common-programming-errors\/","title":{"rendered":"Android: resize an HorizontalScrollView-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m trying to resize at runtime a simple HorizontalScrollView that contains only a Linearlayout this way:<\/p>\n<pre><code>HorizontalScrollView h = (HorizontalScrollView)findViewById(R.id.scrollview_row_1);\nh.setLayoutParams(new FrameLayout.LayoutParams(50,50));\n<\/code><\/pre>\n<p>but then i get this error:<\/p>\n<pre><code>E\/AndroidRuntime(5098): FATAL EXCEPTION: main\nE\/AndroidRuntime(5098): java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams\n<\/code><\/pre>\n<p>How should I resize my scrollView properly?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m trying to resize at runtime a simple HorizontalScrollView that contains only a Linearlayout this way: HorizontalScrollView h = (HorizontalScrollView)findViewById(R.id.scrollview_row_1); h.setLayoutParams(new FrameLayout.LayoutParams(50,50)); but then i get this error: E\/AndroidRuntime(5098): FATAL EXCEPTION: main E\/AndroidRuntime(5098): java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams How should I resize my scrollView properly?<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4310","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4310","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4310"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4310\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4310"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4310"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4310"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}