Android Nougat PopupWindow showAsDropDown(...) Gravity not working : <p>I have this code.</p>

<pre><code>PopupWindow popUp = new PopupWindow();
popUp.setFocusable(true);
popUp.setOutsideTouchable(true);        
popUp.setWidth(ViewGroup.LayoutParams.MATCH_PARENT);
popUp.setHeight(600);

popUp.setContentView(anchorView);
popUp.showAsDropDown(anchorView);
popUp.update();
</code></pre>

<p>And its perfectly works on Android Version &lt; Android Nougat. But in Android Nougat, the popup is being displayed at the top of the screen instead of relative to the anchor view.</p>
