Code Monkey home page Code Monkey logo

Comments (3)

dkozel avatar dkozel commented on May 27, 2024

Hello ultimaters. CircleImageView extends the standard ImageView so all the usual attributes such as layoutHeight should work normally. Can you post the version you are using, your toolbar layout (XML or code), and a screenshot of the toolbar?

Thanks!

from circleimageview.

ultimaters avatar ultimaters commented on May 27, 2024

My toolbar layout:

<android.support.v7.widget.Toolbar             
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/tools"
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:theme="@style/AppTheme.base">

        <de.hdodenhof.circleimageview.CircleImageView
           xmlns:app="http://schemas.android.com/apk/res-auto"
           android:id="@+id/avater_image"
           android:layout_width="wrap_content"
           android:layout_height="wrrap_conten"
           app:border_width="1dp"
           app:border_color="#FFF"/>

        <TextView
            android:id="@+id/tv_header_nickname"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="5dp"
            android:text="nickname"
            android:textSize="@dimen/card_font_head"
            android:textColor="@android:color/white" />

</android.support.v7.widget.Toolbar>

I use the Picasso to load user avater:

ImageView avaterView = (ImageView) findViewById(R.id.avater_image);
Picasso.with(this).load(user.getAvaterURL()).into(avaterView);

the Image is overflow outside the contaner.
eh, I didn't got the screen shot, .sorry

from circleimageview.

hdodenhof avatar hdodenhof commented on May 27, 2024

Please add a screenshot. I assume what you mean is that you only see a part of the image inside the circle, correct? To fix that just set layout_width and layout_height to a fixed value.

This happens, because the scaleType is centerCrop and your avatar is probably larger than the ImageView.

from circleimageview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.