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. Motorola to release ten Android phones in next 6 months?

so there will be.. Motorola Cliq, Motorola Sholes.. and another 8..?? o_O

On Fri, Sep 18, 2009 at 6:42 PM, Meykel a.k.a 'M' <meykel.andro...@gmail.com




--~--~---------~--~----~------------~-------~--~----~
Google Groups "Indonesian Android Community [id-android]" group.

To post to this group, send email to id-android@googlegroups.com

To request to subscribe to this group, please visit the following page:
 

2. Start Intent from onResume?

I have a skeleton system of Activities that will eventually be filled
with GUI elements, but for now I just want to work on a particular
aspect of the project without developing the initial GUI parts first.
But, when I try to launch an Intent from onResume, I get a
RuntimeException in ActivityThread.performResumeActivity.  What is
wrong with the following code?

public class Test extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }

    public void onResume() {
                Intent i = new Intent(this, SecondActivity.class);
                this.startActivity(i);
    }

    public class SecondActivity extends Activity {
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
        }
    }
}

Thanks,
Ben
--~--~---------~--~----~------------~-------~--~----~

3. About Services

4. Donut upgrade and ADC2

5. Urgernt - how to launch my app when open from mail attachment

6. Probing for an already set Alarm?

7. edit box charector based soft key pad