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. Does setPasswordHistoryLength work with PASSWORD_QUALITY_COMPLEX?

The docs for setPasswordHistoryLength are explicit about it working
with NUMERIC, ALPHABETIC, and ALPHANUMERIC settings of password
quality.  The doc leaves out COMPLEX.  I want to know if this omission
is an oversight in the documentation or if history length is not
supported with complex passwords.

Thanks,

 - Steve

P.S.  Here's the doc I am reading:

http://developer.android.com/reference/android/app/admin/DevicePolicyManager.html#setPasswordHistoryLength%28android.content.ComponentName,%20int%29


P.P.S.  If COMPLEX is omitted, why?

-- 

2. ActivityInstrumentationTestCase2 and FragmentActivity

Hi,

I just started experimenting with the new fragment static API.
Whenever I try to use ActivityInstrumentationTestCase2 with a
FragmentActivity I get a "RuntimeException: Exception during
construction error". Is it supposed to work?

Cheers,
Jean-Francois

-- 

3. FragmentActivity class appears to be incompatible with instrumented test classes

4. How to start an activity in a try/catch bloc

5. multiple apks

6. Android Apps Ranked by Daily Usage? Not likely.

7. Project installs on phone, but will not launch