0

in my android project, I have set up a navigation drawer. Now, on swiping, the drawer works fine but I have a few problems that I'd liked solved.

  • There is no drawer icon to the left side of my launcher icon in the action bar. How do you implement that. Also when I click on the action bar icon, the navigation drawer does not slide in.

  • I would like to change the color of the text of my ListView inside my navigation drawer. I tried changing android:textColor in the xml layout but it didn't work.

  • I have the drawer_shadow.9.png drawable of the navigation drawer and I tried implementing it using the setDrawerShadow(drawable, gravity); method but it didn't seem to work. In the two parameters I added the drawable and the ListView R.id for the gravity.

That's just about it. Let me know if you need any more info. Thanks in advance.

Adifyr
  • 2,649
  • 7
  • 41
  • 62

1 Answers1

1

There is no drawer icon to the left side of my launcher icon in the action bar. How do you implement that. Also when I click on the action bar icon, the navigation drawer does not slide in.

Use ActionBarDrawerToggle.

I would like to change the color of the text of my ListView inside my navigation drawer. I tried changing android:textColor in the xml layout but it didn't work.

If the "xml layout" is the one for the row, it should work. If the "xml layout" is the one for the drawer (where your ListView is), it should not work.

In the two parameters I added the drawable and the ListView R.id for the gravity.

From elsewhere in the DrawerLayout documentation, I think your interpretation of the second parameter is off:

Gravity.LEFT to move the left drawer or Gravity.RIGHT for the right. GravityCompat.START or GravityCompat.END may also be used.

Community
  • 1
  • 1
CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Hi, thanks for the input, I'd like to know how to change the color of the text in the listview. – Adifyr Oct 12 '13 at 12:47
  • and also the shadow, I have no idea what to put in the second parameter – Adifyr Oct 12 '13 at 12:50
  • 1
    @ADeveloper: I answered both of those. Your text color comes from your row defintions, such as a layout file that you are using for the row. Try `Gravity.LEFT` or `Gravity.RIGHT` with `setDrawerShadow()`, depending upon whether your drawer is on the left or on the right. – CommonsWare Oct 12 '13 at 12:56
  • I do not have a layout file for my row. I am using simple_list_item_1 – Adifyr Oct 12 '13 at 13:14
  • @ADeveloper: "I do not have a layout file for my row. I am using simple_list_item_1" -- then create your own layout file to use for the rows. – CommonsWare Oct 12 '13 at 13:39