Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CircularImageView can not center in mapView. #64

Open
dyguests opened this issue Sep 19, 2017 · 0 comments
Open

CircularImageView can not center in mapView. #64

dyguests opened this issue Sep 19, 2017 · 0 comments

Comments

@dyguests
Copy link

I created a view with CircularImageView as a marker in mapView.like this:

final View view = LayoutInflater.from(context).inflate(R.layout.view_group_service_head_view, null);
Marker userMarker = aMap.addMarker(userMarkerOptions
                            .icon(BitmapDescriptorFactory.fromView(view));
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http:https://schemas.android.com/apk/res/android"
             xmlns:app="http:https://schemas.android.com/apk/res-auto"
             xmlns:tools="http:https://schemas.android.com/tools"
             android:layout_width="35dp"
             android:layout_height="35dp"
             android:clipChildren="false"
             tools:background="#d8ece3">

    <View
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginBottom="0dp"
        android:layout_marginLeft="0dp"
        android:layout_marginRight="0dp"
        android:layout_marginTop="0dp"
        android:background="@drawable/border_head_circle_stroke_white"/>

    <com.pkmmte.view.CircularImageView
        android:id="@+id/civ_head"
        android:scaleType="centerCrop"
        android:layout_width="match_parent"
        tools:background="#123412"
        android:layout_height="match_parent"
        android:layout_margin="5dp"
        android:src="@mipmap/ic_mine_head_default"/>

    <ImageView
        android:id="@+id/iv_vip"
        android:layout_width="10dp"
        android:layout_height="10dp"
        android:layout_gravity="right|top"
        android:src="@mipmap/ic_mine_growth_vip"
        android:visibility="invisible"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        tools:visibility="visible"/>
</FrameLayout>

There is view in preview:
image

and there is view in phone:
image

And you can see,the CircularImageView not in the center. :(

hope fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant