title: Customize PopupMenu
body: <p>I have a ToolBar with a button that opens a PopupMenu and I wish it just opens below it.
  (<a href="http://openclassrooms.com/forum/sujet/android-personnaliser-la-popupmenu" rel="nofollow">http://openclassrooms.com/forum/sujet/android-personnaliser-la-popupmenu</a>)</p>
  
  <p>Let me explain, when I press the right button of my Toolbar my popup opens ( runs with animation ) just below it the full width of the screen. I can not move the single popup to place it where I want.</p>
  
  <p>Is the PopupMenu is limited in customization? In that case, is there a way to create my combo?</p>
  
  <p>Thank you in advance.</p>
  
  <p><strong>News.java</strong></p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.actualite);
  
      // Initializing
      toolbar = (Toolbar) findViewById(R.id.toolbar);
      button_popup_actu = (Button) findViewById(R.id.show_list_news);
  
      button_popup_actu.setOnClickListener(new View.OnClickListener() {
  
           @Override
           public void onClick(View v) {
               PopupMenu popup = new PopupMenu(News.this, button_popup_actu);
               popup.getMenuInflater().inflate(R.menu.popup_menu_news, popup.getMenu());
               popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
                   public boolean onMenuItemClick(MenuItem item) {
                       Toast.makeText(News.this, "You Clicked : " + item.getTitle(), Toast.LENGTH_SHORT).show();
                       return true;
                   }
               });
               popup.show();
           }
       });
  }
  </code></pre>
  
  <p><strong>/menu/Popup_menu_new.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;menu xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;item
          android:id="@+id/news"
          android:title="News"/&gt;
  
      &lt;item
          android:id="@+id/work"
          android:title="Works"/&gt;
  
      &lt;item
          android:id="@+id/about"
          android:title="About"/&gt;
  &lt;/menu&gt;
  </code></pre>
  
  <p>/layout/row_list_popup.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="horizontal"&gt;
  
      &lt;TextView
          android:id="@+id/icon_color"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="||"/&gt;
      &lt;TextView
          android:id="@+id/title_row_spinner"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"/&gt;
      &lt;TextView
          android:id="@+id/number_none_view"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="1"/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>