android - How to reduce size of LinearLayout with Background Image large one -


i trying draw 2 layouts vertically top 1 containing image,since image big,it occupying portion of botton half,i used weights =1 , layoutheight=0dp partition equally,

without image,partition perfect,but if set background image toplayout ,weight ratio not perfect,which of no reuse,

i tried using framelayout,which of no use,

what exact way of doing in xml,instead of assiging layouts height programmatically.

try this:

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:orientation="vertical" android:layout_width="match_parent"     android:layout_height="match_parent"     android:weightsum="1">      <linearlayout         android:orientation="vertical"         android:layout_width="match_parent"         android:layout_height="0dp"         android:layout_weight="0.5">    </linearlayout>      <linearlayout         android:orientation="vertical"         android:layout_width="match_parent"         android:layout_height="0dp"         android:layout_weight="0.5">     </linearlayout> </linearlayout> 

then can set image background top layout.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -