How to make a frame around the element?
I need to get something like the following: alt text
Interested in how you can make such a frame in size of the list item and how to make a separate frame to the end of the screen

UPD
By the way, is it possible to somehow remove the application logo so that it does not pop up in the actionBar? UPD2

public boolean onCreateOptionsMenu(Menu menu) { menuItem = menu.findItem(R.id.reload_button); menuItem.setEnabled(true); menuItem.setVisible(true); getMenuInflater().inflate(R.menu.menu, menu); return true; } 

But xml:

  <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/reload_button" android:icon="@android:drawable/ic_menu_rotate"> </item> </menu> 
  • one
    This is called the nine-patch - a specially shaped png file with utility markup that sets the rules for stretching 'and the location of internal content. Read more in the documentation. - falstaf pm
  • And just create at least a frame in the listView will not work? - Stas0n
  • 2
    Make a shape with a frame ( stroke ) and put it on the background the ListView . You can also apply this shape to ListView items. - tim_taller
  • The question of oftopom: is it possible to somehow remove the application logo so that it doesn't appear at all in the actionBar? - Stas0n

2 answers 2

Well, actually, that's what happened:

 <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <solid android:color="#ffffff" /> <corners android:bottomLeftRadius="8dp" android:bottomRightRadius="8dp" android:topLeftRadius="8dp" android:topRightRadius="8dp" /> <stroke android:width="1dp" android:color="#808080" /> 

alt text

      public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu, menu); menuItem = menu.findItem(R.id.reload_button); menuItem.setEnabled(true); menuItem.setVisible(true); return true; 

    }

    This code does not display reloadbutton

    • Let's better create a separate question and we will no longer offtopic it. - falstaf