Привет, я хочу показать свой всплывающий макет внизу панели действий.Но я попытался позиционировать вид на другой вид.
То, что я хотел: ![enter image description here](https://i.stack.imgur.com/vnUfC.png)
И я на самом деле получаю это:
![enter image description here](https://i.stack.imgur.com/cSiJn.png)
Что я пытался добиться этого.
// Раздуть макет
View filterLayout = getLayoutInflater().inflate(R.layout.tooltip_layout, null);
filterPopup = new PopupWindow(this);
/* filterPopup.setWidth(ListPopupWindow.MATCH_PARENT);
filterPopup.setHeight(ListPopupWindow.WRAP_CONTENT);*/
filterPopup.setOutsideTouchable(true);
filterPopup.setContentView(filterLayout);
filterPopup.setBackgroundDrawable(new BitmapDrawable());
filterPopup.setFocusable(true);
// Показать макет нижней части панели действий
int[] location = new int[2];
mActivityMainBinding.appBarMain.contentMain.mainContentLayout.getLocationOnScreen(location);
Point point = new Point();
point.x = location[0];
point.y = location[1];
filterPopup.showAtLocation(mActivityMainBinding.appBarMain.toolbar, Gravity.LEFT | Gravity.TOP, point.x, point.y);
// Это мой макет подсказки
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
card_view:cardBackgroundColor="#fffff">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/color_white"
android:orientation="vertical"
android:padding="10dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/futura_medium"
android:text="Have you selected the right location ?"
android:textColor="@color/colorSection"
android:textSize="@dimen/text_sizes_medium" />
<View
android:layout_width="match_parent"
android:layout_height="10dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/futura_medium"
android:lineSpacingExtra="4dp"
android:text="Your selected location seems to be little far off from your device location"
android:textColor="@color/colorTextPrimery"
android:textSize="@dimen/text_sizes_medium" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="@+id/text_no_thanks"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="@font/futura_medium"
android:gravity="center"
android:text="NO THANKS"
android:textColor="@color/colorTextPrimery"
android:textSize="@dimen/text_sizes_smaller" />
<View
android:layout_width="20dp"
android:layout_height="match_parent" />
<TextView
android:id="@+id/text_change_location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:background="@drawable/selector_ligt_to_dark_no_radius"
android:fontFamily="@font/futura_medium"
android:gravity="center"
android:padding="6dp"
android:text="CHANGE LOCATION"
android:textColor="@color/color_white"
android:textSize="@dimen/text_sizes_smaller" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="60dp"
android:background="@android:color/transparent"
android:src="@drawable/arrow_white" />
</FrameLayout>
Может кто-нибудь подсказать мне, что я могу сделать для достижения этой цели?Я хочу показать макет представления карты, чтобы выровнять с выравниванием нижней панели действий.