proble getheigth of image

Put your problem here if it does not fit any of the other categories.

proble getheigth of image

Postby soniya » Tue Mar 04, 2008 3:38 pm

i used imageview

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <ImageView android:id="@+id/im"
  2.  
  3.      android:layout_width="fill_parent"
  4.  
  5.      android:layout_height=""fill_parent"
  6.      android:layout_marginTop="@dimen/ten_pixel"
  7.      android:layout_marginLeft="@dimen/six"
  8.      android:background="@drawable/xs21"
  9.      />
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


in java file
ImageView im=(ImageView)findViewById(R.id.im);
im.getHeight();
it's always show zero value....how to get height of image????
soniya
Senior Developer
Senior Developer
 
Posts: 111
Joined: Mon Jan 14, 2008 1:52 pm
Location: india

Top

Postby snowtiger » Tue Mar 04, 2008 4:16 pm

Try to set some content to your ImageView:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. im.setImageBitmap(Bitmap); //or:
  2.  
  3. im.setImageDrawable(Drawable);
Parsed in 0.030 seconds, using GeSHi 1.0.8.4
snowtiger
Developer
Developer
 
Posts: 34
Joined: Fri Dec 21, 2007 10:44 am

Postby res » Tue Mar 04, 2008 4:27 pm

If you look at your .xml file you have 2 quote marks before fill_parent in the android:layout_height=""fill_parent" line.
res
Senior Developer
Senior Developer
 
Posts: 146
Joined: Tue Nov 20, 2007 8:14 pm
Location: United States

Postby soniya » Wed Mar 05, 2008 6:45 am

im use single quote.........it mistake in copy and paste.... :(
soniya
Senior Developer
Senior Developer
 
Posts: 111
Joined: Mon Jan 14, 2008 1:52 pm
Location: india

Postby plusminus » Wed Mar 05, 2008 9:58 am

:oops: we could have even seen that through the syntax-highlighting ^^

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 26 guests