Defining an XML vertical line drawable

by Caspa » Mon, 19 Apr 2010 04:09:09 GMT

Sponsored Links

I'm trying to figure out how to define a verical line (1px thick) to
be used as a drawable.

to make a horizontal one, it's pretty straightforward:

<shape xmlns:android="" ;
    <stroke android:width="1dp" android:color="#0000FF"/>
    <size android:height="50dp" />

The question is, how to make this line vertical?

Yes, there are workarounds, such as drawing a rectangle shape 1px
thick, but that complicates the drawable xml, if it consists of
multiple <item> elements.

Anyone had any chance with this?


Defining an XML vertical line drawable

by patbenatar » Mon, 19 Apr 2010 17:37:55 GMT

 You could use a 1x1 Nine-Patch PNG....


Sponsored Links

Defining an XML vertical line drawable

by Caspa » Tue, 20 Apr 2010 23:49:39 GMT

 Thanks for the suggestion patbenatar!

I'm aware I could go for a 1px png drawable or draw the vertical line
as a View etc.

However since there is a "line" shape, I assume there is a way of
drawing it vertically, or at least there SHOULD be.

Can anyone confirm this being possible / not possible?


> >

Defining an XML vertical line drawable

by patbenatar » Wed, 21 Apr 2010 03:29:46 GMT

 Yea my idea is largely a hack... Always better to confirm no standard
method exists before pursuing hacks :)

> > >

Other Threads

1. Contact database 鈥?Group c reation ?

You should be able to insert into that table to create the actual
group, and then you can add people to the group using,%20long,%20long).



2. openOrCreateDatabase or what?

Prior to release 0.9 one could do the following to open or create a
SQLite database:

try {
  db = context.openDatabase(DATABASE_NAME, null);
} catch (FileNotFoundException e) {
  db = context.createDatabase(DATABASE_NAME, DATABASE_VERSION,
                                                Context.MODE_PRIVATE, null);

So if the application can't open the database it creates a new one and
creates all tables and inserts test data.

Now both methods are gone and there is a single method

This method doesn't allow the programmer to distinguish between
opening an existing and creating a new database.
To decide if it should call createTables() and insertSampleData()
additional checks are necessary.

Can someone explain the background why this change was introduced? I
always prefer a clear contract of the API like different methods for
open(), close(), create(). Or did I miss something?

3. AutoCompleteTextView showing filtered results

4. Use Android as embedded platform

5. Skin editors (?)

6. How to set AlertDialog button focus?

7. Custom Components in a different package?