Wrox Programmer Forums
|
BOOK: Professional Android 2 Application Development
This is the forum to discuss the Wrox book Professional Android 2 Application Development, 2nd Edition by Reto Meier; ISBN: 978-0-470-56552-0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Android 2 Application Development section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 13th, 2011, 05:51 PM
Registered User
 
Join Date: Jun 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to solo
Question A solid red Drawable resource

Hi,

The code should give me a rectangular Shape Drawable with a solid
fill, rounded edges, 10dp outline, and 10dp of padding around
each edge.

But where should I put the code??

Code:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
   android:shape="rectangle">
      <solid
         android:color="#f0600000"/>
      <stroke
         android:width="10dp"
         android:color="#00FF00"/>
      <corners
         android:radius="15dp" />
      <padding
         android:left="10dp"
         android:top="10dp"
         android:right="10dp"
         android:bottom="10dp"
      />
</shape>
 
Old June 15th, 2011, 09:04 PM
Registered User
 
Join Date: Jun 2011
Posts: 5
Thanks: 0
Thanked 1 Time in 1 Post
Default

This is a generic shape defined in XML.

file location:
res/drawable/filename.xml
The filename is used as the resource ID.

resource reference:
In Java: R.drawable.filename
In XML: @[package:]drawable/filename
---------------------------------------------
Good luck!





Similar Threads
Thread Thread Starter Forum Replies Last Post
[red]Setting prob[/red] shivanshub ASP.NET 2.0 Professional 1 September 12th, 2006 10:01 AM
How to create solid caret in C# mr_deb C# 0 June 23rd, 2006 01:58 AM
Dreaded red X sibbs Dreamweaver (all versions) 3 February 17th, 2006 07:56 PM
from color="red" to color='red' juaniux XSLT 2 November 16th, 2004 04:18 PM
How to find RGB %'s of a solid colour image rhofing General .NET 0 June 11th, 2004 01:26 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.