Re: [android-developers] Webview inside Scroll doesn't resize

2010-09-18 Thread Mark Murphy
On Sat, Sep 18, 2010 at 3:44 AM, Edwin edwin...@gmail.com wrote:
 Hi all, I put a webview inside a scroll view according to this
 http://www.anddev.org/view-layout-resource-problems-f27/add-imageview-to-bottom-of-webview-t19169.html
 .
 But I found that if the webview already loaded a long content, and
 then load short content again. The webview doesn't resize and the
 scroll bar is still here.

 for example, load testbr/br/br/br/br/br/br/br/br/
br/br/br/br/br/br/br/br/br/br/br/ and then
 load test in the webview will cause this problem.

 How can I resize the webview the fit the content.

I do not expect a WebView inside a ScrollView will work. They both
know how to scroll, and scrollable things in scrollable things does
not work well in Android. I suggest that you come up with a UI design
that can avoid this requirement.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in Atlanta: http://bignerdranch.com/classes/android

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Webview inside Scroll doesn't resize

2010-09-18 Thread Kwok Chun Wing, Edwin
Umm...I got your point, but I really need to have an image below a 
webview, is there any suggest that is without using scroll view

Thanks


On 09/18/2010 06:49 PM, Mark Murphy wrote:

On Sat, Sep 18, 2010 at 3:44 AM, Edwinedwin...@gmail.com  wrote:
   

Hi all, I put a webview inside a scroll view according to this
http://www.anddev.org/view-layout-resource-problems-f27/add-imageview-to-bottom-of-webview-t19169.html
.
But I found that if the webview already loaded a long content, and
then load short content again. The webview doesn't resize and the
scroll bar is still here.

for example, load testbr/br/br/br/br/br/br/br/br/
 

br/br/br/br/br/br/br/br/br/br/br/ and then
   

load test in the webview will cause this problem.

How can I resize the webview the fit the content.
 

I do not expect a WebView inside a ScrollView will work. They both
know how to scroll, and scrollable things in scrollable things does
not work well in Android. I suggest that you come up with a UI design
that can avoid this requirement.
   


--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Webview inside Scroll doesn't resize

2010-09-18 Thread Mark Murphy
On Sat, Sep 18, 2010 at 7:03 AM, Kwok Chun Wing, Edwin
edwin...@gmail.com wrote:
 Umm...I got your point, but I really need to have an image below a webview,
 is there any suggest that is without using scroll view

Option #1: Put the WebView in a LinearLayout or RelativeLayout, and
put the ImageView below that.

Option #2: Put the image in the WebView by modifying the HTML.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in Atlanta: http://bignerdranch.com/classes/android

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Webview inside Scroll doesn't resize

2010-09-18 Thread Kwok Chun Wing, Edwin
I think the first option is not suitable for me since I need the image 
be shown only when it is scrolled to the end.


It maybe good to add some html in the webview content, but I want to 
know how to right such html
img src=image location/, but the image is stored in the drawable, 
how the html can obtain such image?


Thanks for your advice.

On 09/18/2010 07:09 PM, Mark Murphy wrote:

On Sat, Sep 18, 2010 at 7:03 AM, Kwok Chun Wing, Edwin
edwin...@gmail.com  wrote:
   

Umm...I got your point, but I really need to have an image below a webview,
is there any suggest that is without using scroll view
 

Option #1: Put the WebView in a LinearLayout or RelativeLayout, and
put the ImageView below that.

Option #2: Put the image in the WebView by modifying the HTML.
   


--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Webview inside Scroll doesn't resize

2010-09-18 Thread Mark Murphy
On Sat, Sep 18, 2010 at 7:17 AM, Kwok Chun Wing, Edwin
edwin...@gmail.com wrote:
 I think the first option is not suitable for me since I need the image be
 shown only when it is scrolled to the end.

That may or may not prove to be possible.

 It maybe good to add some html in the webview content, but I want to know
 how to right such html
 img src=image location/, but the image is stored in the drawable, how
 the html can obtain such image?

Try android.resource://package_name/drawable/name, where:

-- package_name is the name of your application's package
-- name is the name of the image resource

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in Atlanta: http://bignerdranch.com/classes/android

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en