android - Layout pushing views down the screen -
so, have imageview inside framelayout. need way. feel issue here image , it's size itself. layout image pushes further down other views on screen leaving considerable empty space that's supposed layout.
i found hard coding height value let's me minimize issue. if height wrap_content image reach same point blank space supposed layout extends extreme lengths.
so want know if image size (or resolution?) problem (which seems be) or else, , if there better solution hardcoding layout height. in advance.
here code:
<linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <framelayout android:layout_width="match_parent" android:layout_height="700dp"> <imageview android:id="@+id/image_header" android:layout_width="match_parent" android:layout_height="wrap_content" android:scaletype="fitstart" android:src="@drawable/me_and_gundam" /> <view android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/gradient" /> </framelayout> <textview android:fitssystemwindows="true" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginbottom="16dp" android:text="my nanodegree apps!" android:textalignment="center" android:textsize="24sp" />
and here looks like:
have tried putting frame layout height wrap_content worked me fine
<imageview android:id="@+id/image_header" android:layout_width="match_parent" android:layout_height="wrap_content" android:scaletype="fitstart" android:src="@drawable/me_and_gundam" /> <view android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/gradient" /> </framelayout>
Comments
Post a Comment