Evan,

I am also struggling with this same problem. It's mystifying because
so many widgets seem to have this look and yet I find it hard to
believe that all the developers painstakingly did it by hand.

Can you post a screenshot of what you have? In what way is yours just
a couple of pixels off?

Also, did you make that text_border file yourself? (I assume it is a
ninepatch...?) I scanned the SDK for *.9.png and found several
ninepatches that were similar but none that looked exactly right.
(Here's an example of how mine looks with the Toast ninepatch:
http://screencast.com/t/zEyDZr8fnI) It sure seems like if we found the
right ninepatch image we'd just have to add the faint shadow to the
text and then we'd be home free.

On Oct 29, 10:40 pm, Evan Ruff <[email protected]> wrote:
> Hey Guys,
>
> I was hoping someone could help me with a home screenwidgetI'm
> trying to layout. Basically, I'm trying to layout mywidgetso it
> matched a standard home screen application shortcut perfectly.
> Basically, at this point, I'm about ~2px off and it's driving me
> crazy! Has anyone gotten this to match up juuuuust right? Should I be
> able to find this layout in the source somewhere? Any clues would be
> much appreciated. Here's my layout thus far:
>
> drawable/text_border.xml - For the black background around thetext:
> <shape xmlns:android="http://schemas.android.com/apk/res/android";>
>     <solid android:color="#99000000"/>
>     <padding android:left="5dp" android:right="5dp"
> android:bottom="1dp" android:top="1dp" />
>     <corners android:radius="7dp" />
> </shape>
>
> layout/widget.xml - Thewidgetitself:
> <?xml version="1.0" encoding="utf-8"?>
> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/
> android"
>             android:layout_width="fill_parent"
>             android:layout_height="fill_parent"
>             android:layout_gravity="center"
>         >
>         <LinearLayout xmlns:android="http://schemas.android.com/apk/res/
> android"
>             android:orientation="vertical"
>             android:layout_width="wrap_content"
>             android:layout_height="wrap_content"
>             android:layout_gravity="center"
>             >
>           <ImageView android:id="@+id/icon"
>             android:layout_gravity="center"
>             android:src="@drawable/icon_gray"
>             android:layout_width="wrap_content"
>             android:layout_height="wrap_content"
>             android:paddingBottom="5px"
>             android:paddingTop="5px"
>           />
>           <TextView android:id="@+id/message"
>             android:layout_width="wrap_content"
>             android:layout_height="wrap_content"
>             android:background="@drawable/text_border"
>             android:textColor="#FFFFFFFF"
>             android:layout_gravity="center"
>             android:text="Assistant"
>             android:textSize="12px"
>         />
>         </LinearLayout>
> </FrameLayout>
>
> Thanks for any help tuning this badboy.
>
> Thanks!
>
> Evan

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to