shadow in imageview

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

shadow in imageview

Postby rmeph » Mon Feb 04, 2008 12:16 pm

how to use shadow on imageview

i used in code

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <ImageView id="@+id/img1"
  2.  
  3.      android:layout_width="fill_parent"
  4.  
  5.      android:layout_height="@dimen/sixteen_pixel"
  6.  
  7.      android:src="@drawable/shape_1"
  8.  
  9.     android:shadowColor="#447447"
  10.  
  11.    android:shadowDx="@dimen/ten_pixel"
  12.  
  13.    android:shadowRadius="@dimen/ten_pixel"
  14.  
  15.   android:shadowDy="@dimen/ten_pixel"
  16.  
  17. />
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


but it cannot show anything????/ :(
rmeph
Senior Developer
Senior Developer
 
Posts: 121
Joined: Mon Dec 10, 2007 1:54 pm
Location: India

Top

Postby plusminus » Mon Feb 04, 2008 12:31 pm

Hello rmeph,

SDK-Documentation says :darrow:. Your problem probably was that you supplied "10px" to the parameters and not floating point values:
public static final int shadowDx
Horizontal offset of the shadow.
Must be a floating point value, such as "1.2".

#############

public static final int shadowDy
Vertical offset of the shadow.
Must be a floating point value, such as "1.2".

#############

public static final int shadowRadius
Radius of the shadow.
Must be a floating point value, such as "1.2".


The following worked fine with me:
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <TextView
  2.         android:layout_width="wrap_content"
  3.         android:layout_height="wrap_content"
  4.         android:shadowColor="#F00"
  5.         android:shadowDx="1.2"
  6.         android:shadowDy="1.2"
  7.         android:shadowRadius="1.2"
  8.         android:text="Test" />
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


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

Postby rmeph » Mon Feb 04, 2008 12:35 pm

is it use with imageview??

in imageview im draw rectangle.... :roll:
rmeph
Senior Developer
Senior Developer
 
Posts: 121
Joined: Mon Dec 10, 2007 1:54 pm
Location: India

Postby plusminus » Mon Feb 04, 2008 12:50 pm

Hello rmeph,

oh sorry. you had ImageView typed.

No these attributes are only available to TextView and subclasses of it. (Like Button and EditText).

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

Postby rmeph » Mon Feb 04, 2008 1:31 pm

what will be use for imageview's shadow???
rmeph
Senior Developer
Senior Developer
 
Posts: 121
Joined: Mon Dec 10, 2007 1:54 pm
Location: India

Postby plusminus » Mon Feb 04, 2008 2:41 pm

Hello rmeph,

I found nothing "built in", but you could override onDraw(); of ImageView.

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 View, Layout & Resource Problems

Who is online

Users browsing this forum: Google Feedfetcher, Majestic-12 [Bot] and 4 guests