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. onscreen keypad interactions

I've seen with the onscreen keypad, the application does not seem to
be notified that the OSK has been brought in front of it.

I would like to be able to change the layout of my screen so that
relevant information is visible when the keypad is brought to the
fore.  I have information onscreen that changes as the user types in a
number.

Also, the implementation of the OSK in landscape mode completely
breaks the functionality of our application since the OSK takes over
the complete screen.  It would be much better for us if a 12-key
numeric keyboard were available on one side of the screen and leave
the other side available to the application.

Can there be layout qualifiers such as we have with layout-land-
keyshidden...such as layout-land-osk?

- John
--~--~---------~--~----~------------~-------~--~----~

2. Usage of SecurityManager in Androids Permission-Syste

Hi List,

I'm trying to understand how and if the (Java)-SecurityManager is integrated in
the whole Android permissions-concept. I'm asking because it occured to
me, that the NetPermission might be suitable to enforce the access to
Network for specific applications (such as the INTERNET permission).
Also I have seen that the Android-Team made some changes to the
Apache Harmony SecurityManager-Code in Android.

To detail my question:
* Are they any active "java.policy" files during the life time of a dalvik
instance? If yes
  * Are they generated from the permissions in the AndroidManifest.xml?
* Is thery any good starting point for me to get a better understanding
of the permission enforcement? 

Thanks in advance for any replies :-)
Chris



-- 
tarent Gesellschaft fr Softwareentwicklung und IT-Beratung mbH

Heilsbachstr. 24, 53123 Bonn  | Poststr. 4-5, 10178 Berlin
fon: +49(228) / 52675-0       | fon: +49(30) / 27594853
fax: +49(228) / 52675-25      | fax: +49(30) / 78709617

Geschftsfhrer
Boris Esser, Elmar Geese
HRB AG Bonn 5168
Ust-ID: DE122264941

3. Sorry if I've missed this somewhere, but what is the default thread stack size in Android...

4. Is this a bug in dvmTrackExternalAllocation()?

5. having grub bootloader on a separate partition for live USB on x86

6. Picture Taking application

7. One line causing lots of garbage collection. String.format with float. Help?