How to set Parent ImageView Style

by mac-systems » Wed, 09 Mar 2011 18:31:23 GMT


Sponsored Links
 Hello,

i've just cant figure out why this should be wrong ?

<style name="Logo" parent="@android:style/Widget.ImageView">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">@dimen/title_height</item>
<item name="android:src">@drawable/mv_logo</item>
<item name="android:paddingLeft">5dp</item>
<item name="android:paddingRight">5dp</item>
</style>

Eclipse complain about the parent :error: Error retrieving parent for
item: No resource found that matches the given name '@android:style/
Widget.ImageView'.

Whats is different for an ImageView ?

Thx,
Jens


-- 



Re: How to set Parent ImageView Style

by Kostya Vasilyev » Wed, 09 Mar 2011 18:34:47 GMT


 09.03.2011 13:31, mac-systems :
Eclipse complain about the parent :error: Error retrieving parent for item: No resource found that matches the given name '@android:style/ Widget.ImageView'. Whats is different for an ImageView ?
There isn't a Widget.ImageView style in Android as far as I can tell. Check styles.xml in android-sdk\platforms\android-X\res\values. Besides, your definition looks quite complete enough to not need a parent style. -- Kostya Vasilyev -- http://kmansoft.wordpress.com --


Sponsored Links


Re: How to set Parent ImageView Style

by mac-systems » Wed, 09 Mar 2011 18:58:46 GMT


 I'm still curios about that there is no parent style, my understanding
was
that a lot of the default behaviour comes from this styles?
For example the scaletype has a default value,i think....

Thx a lot,
Jens




-- 



Re: Re: How to set Parent ImageView Style

by Kostya Vasilyev » Wed, 09 Mar 2011 19:44:36 GMT


 Well, I can only guess but -

Image view attributes have to do with two things: "what" and "how", as 
in, what image to display, and how it should be done. Having defaults 
for those probably doesn't make sense: would you want ImageView to have 
a default image, if "src" is not specified?


The only exception is scaleType, which has a reasonable default value, 
fitCetner, set in the code.


Compare this with, for example, Widget.CompoundButton.CheckBox - the 
default attribute values there are quite useful, since they make the 
widget look and behave as expected, i.e. a check box.


Also see Widget.ImageButton - which is a subclass of ImageView. Again, 
this style provides useful defaults so that all ImageButton's look and 
behave as expected.


-- Kostya

09.03.2011 13:58, mac-systems :
I'm still curios about that there is no parent style, my understanding was that a lot of the default behaviour comes from this styles? For example the scaletype has a default value,i think.... Thx a lot, Jens
09.03.2011 13:31, mac-systems :
Eclipse complain about the parent :error: Error retrieving parent for item: No resource found that matches the given name '@android:style/ Widget.ImageView'. Whats is different for an ImageView ?
There isn't a Widget.ImageView style in Android as far as I can tell. Check styles.xml in android-sdk\platforms\android-X\res\values. Besides, your definition looks quite complete enough to not need a parent style. -- Kostya Vasilyev -- http://kmansoft.wordpress.com
-- Kostya Vasilyev -- http://kmansoft.wordpress.com --



Other Threads

1. map sdcard to drive letter or directory on windows



Mount it as a USB drive. You should have an option to do that when you
slide down the notification drawer with the USB cable attached.

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

Android Consulting/App Development: http://commonsware.com/consulting

-- 

2. map sdcard to drive letter or directory on windows

is there a way to map the sdcard (/sdcard) to a drive letter or
directory on a windows box?

i can always do "adb pull /sdcard sdcard" but that can take a while if
you've got a lot of stuff on there...

tia.

-- 

3. please help me with opengl exception.

4. WebView losing onTouchListener when BuiltinZoomControls are used?

5. How to communication with PC client.

6. Socket - Network connect drops after 15 minutes

7. continuous update of a texture