Simple LinearLayout help

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Simple LinearLayout help

Postby vadimz » Fri Dec 11, 2009 5:45 pm

UPDATE: SOLVED HERE

I need to make layout, where Ad will be on bottom and will take all possible width and wrap-content height.
The all other area upper must be taken by WebView.
What I do incorrect, so that Ad is not visible at all? (no gravity or align at bottom helped)
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3.         xmlns:admobsdk="http://schemas.android.com/apk/res/com.test.book1"
  4.    android:orientation="vertical"
  5.    android:layout_width="fill_parent"
  6.    android:layout_height="fill_parent"
  7.    >
  8.  
  9.         <WebView  
  10.    android:layout_width="fill_parent"
  11.    android:layout_height="fill_parent"
  12.    android:gravity="top"
  13.    android:text="@string/hello"
  14.    android:id="@+id/browser"
  15.    />    
  16.  
  17.     <com.admob.android.ads.AdView
  18.      android:id="@+id/ad"      
  19.      android:layout_width="fill_parent"
  20.      android:layout_height="wrap_content"
  21.      admobsdk:backgroundColor="#0f0f00"
  22.      admobsdk:textColor="#FFFFFF"
  23.      admobsdk:keywords=""
  24.      admobsdk:testing="true"
  25.    />  
  26.  
  27. </LinearLayout>  
Parsed in 0.003 seconds, using GeSHi 1.0.8.4
Last edited by vadimz on Sat Dec 12, 2009 11:46 am, edited 1 time in total.
vadimz
Developer
Developer
 
Posts: 44
Joined: Thu Jul 30, 2009 5:04 pm
Location: Moldova

Top

Postby achie1266 » Fri Dec 11, 2009 7:28 pm

set android:layout_gravity="1" and android:layout_height="wrap_content" for webview
the rest looks fine

hope it solves it. Let me know if doesn't and I will test it out.
achie
User avatar
achie1266
Master Developer
Master Developer
 
Posts: 223
Joined: Mon Nov 09, 2009 10:56 pm
Location: Denver

Postby vadimz » Fri Dec 11, 2009 11:27 pm

achie1266 wrote:set android:layout_gravity="1"

1 is not allowed, tried
"center_horizontal": 0x01 Place object in the horizontal center of its container, not changing its size.

But no result :(
I applied both options to WebView as I understood.

Thank you very much for reply.
vadimz
Developer
Developer
 
Posts: 44
Joined: Thu Jul 30, 2009 5:04 pm
Location: Moldova

Postby vadimz » Fri Dec 11, 2009 11:29 pm

It seems I do nt understand layouts at all, because it is very typical task - align one control and use all space for another :)
vadimz
Developer
Developer
 
Posts: 44
Joined: Thu Jul 30, 2009 5:04 pm
Location: Moldova

Postby achie1266 » Fri Dec 11, 2009 11:59 pm

Sorry my bad
I meant to say android:layout_weight="1"
and android:layout_height="wrap_content"

That should work
when you set layout_weight="1" it occupies all the remaining area in the layout .
achie
User avatar
achie1266
Master Developer
Master Developer
 
Posts: 223
Joined: Mon Nov 09, 2009 10:56 pm
Location: Denver

Postby vadimz » Sat Dec 12, 2009 9:21 am

Thank you very much. It works )
I even made you screenshout to see result of your advice :)
Image
vadimz
Developer
Developer
 
Posts: 44
Joined: Thu Jul 30, 2009 5:04 pm
Location: Moldova

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Google Feedfetcher and 4 guests