Using ImageView in XML

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Using ImageView in XML

Postby s.semeria » Wed Apr 16, 2008 9:18 am

Hello,

Just a simple question. I would like to use an ImageView in my custom layout declaring it in xml file (basically I would like to declare an ImageView also referencing the drawable in xml).

Is that possible and how?
Could you provide some reference?

Thanks a lot

Regards,

s.semeria
s.semeria
Junior Developer
Junior Developer
 
Posts: 23
Joined: Mon Jan 28, 2008 10:18 am
Location: Italy

Top

Re: Using ImageView in XML

Postby kingkung » Mon Apr 21, 2008 11:34 pm

Hi semeria,

Yes, it's definitely possible (just use the ImageView tag in your layout xml file), and I'm actually wondering about
it as well... how do I load an image that I have stored in the project folder? If someone could show me some sample code, or even pseudo-code, that would be dandy.

Thanks,

James

s.semeria wrote:Hello,

Just a simple question. I would like to use an ImageView in my custom layout declaring it in xml file (basically I would like to declare an ImageView also referencing the drawable in xml).

Is that possible and how?
Could you provide some reference?

Thanks a lot

Regards,

s.semeria
kingkung
Freshman
Freshman
 
Posts: 9
Joined: Wed Apr 16, 2008 6:24 pm

Re: Using ImageView in XML

Postby saty_32016 » Tue Apr 22, 2008 6:52 am

kingkung wrote:Hi semeria,

Yes, it's definitely possible (just use the ImageView tag in your layout xml file), and I'm actually wondering about
it as well... how do I load an image that I have stored in the project folder? If someone could show me some sample code, or even pseudo-code, that would be dandy.

Thanks,

James

s.semeria wrote:Hello,

Just a simple question. I would like to use an ImageView in my custom layout declaring it in xml file (basically I would like to declare an ImageView also referencing the drawable in xml).

Is that possible and how?
Could you provide some reference?

Thanks a lot

Regards,

s.semeria



What actually you people want. if u want to declare imageView in xml here is code
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <ImageView android:id="@+id/image"
  2.      android:layout_width="wrap_content"
  3.      android:layout_height="wrap_content"
  4.      android:layout_marginTop="5mm"
  5.      android:layout_marginLeft="10mm"
  6.      
  7.      />
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


and you can declare it in java code also.if any thing else you want let me know.
saty_32016
Developer
Developer
 
Posts: 27
Joined: Mon Mar 10, 2008 4:47 am

Postby Jesmiatka » Tue Apr 22, 2008 8:18 am

I think they mean this..
Not sure either ;-)

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. <ImageView android:id="@+id/image"
  2.  
  3.       android:layout_width="wrap_content"
  4.  
  5.       android:layout_height="wrap_content"
  6.  
  7.       android:src="@drawable/<nameherewithoutextension>"
  8.  
  9.       />
Parsed in 0.030 seconds, using GeSHi 1.0.8.4



Your sincerely,
Mike
Jesmiatka
Senior Developer
Senior Developer
 
Posts: 164
Joined: Mon Feb 04, 2008 3:37 pm
Location: Netherlands

Postby s.semeria » Wed Apr 30, 2008 2:40 pm

Yeah Jesmiatka,

that's exactly what I was looking for.

Thanks a lot to all anyway.

Regards,

s.semeria
s.semeria
Junior Developer
Junior Developer
 
Posts: 23
Joined: Mon Jan 28, 2008 10:18 am
Location: Italy

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 8 guests