-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
How to hide the AvatarView with v1.0.0 #674
Comments
After a short chat in the slack channel I found a solution based on the suggestion from @creyD.
|
doing this in viewdidload ^^ still gave me an avatar on outgoing messages |
I also did this change in the
|
it works now, just moving it to the bottom of my viewDidLoad did it. not sure how this affect it. |
You can also set the avatar size for all other kind of messages. Please have a look into To change the avatar size you do same as desribed but with a different
|
@Faisal0sal keep in mind cells are reused Sent with GitHawk |
@JulienLevallois I'm not sure exactly. What is your MessageKit version? Have you tried clearing derived data folder? |
I need to update to 0.13.5 or 1.0.0-beta.1 ? Because with pod 'MessageKit' and pod install i got this version 0.13.0 |
You need |
I got this error :/ [!] Failed to connect to GitHub to update the CocoaPods/Specs specs repo - Please check if you are offline, or that GitHub is down |
This is what worked for me. |
@JulienLevallois Please create a separate issue for your question. Thanks! |
Tried setting the avatar size using the following but I'm still getting blank spaces in the avatar area. override func viewDidLoad() {
super.viewDidLoad()
// some code here
if let layout = messagesCollectionView.collectionViewLayout as? MessagesCollectionViewFlowLayout {
layout.textMessageSizeCalculator.outgoingAvatarSize = .zero
layout.textMessageSizeCalculator.incomingAvatarSize = .zero
}
} What am I missing? |
@jaunesarmiento because each case of |
Ah! @SD10 silly me. Thanks for pointing it out. |
@SD10 it would be nice to somehow be able to set avatar sizes for all calculators at once rather than having to set size on each calculator individually, for convenience's sake. Do you think there's a place for that in the 1.0 API? |
@ndonald2 Maybe 🤔 The maintenance burden for that would be lightweight but I dislike expanding the API surface area with something a user could do themselves. We would have to also look at a convenience method for the other calculator properties as well. |
I totally agree, but as you mentioned the maintenance cost for this would be quite low. In my opinion it seems like a very common use case to just want to change MK's default avatar size, which for both outgoing and incoming messages across all message types is currently extremely verbose: layout.textMessageSizeCalculator.incomingAvatarSize = avatarSize
layout.textMessageSizeCalculator.outgoingAvatarSize = avatarSize
layout.attributedTextMessageSizeCalculator.incomingAvatarSize = avatarSize
layout.attributedTextMessageSizeCalculator.outgoingAvatarSize = avatarSize
layout.videoMessageSizeCalculator.incomingAvatarSize = avatarSize
layout.videoMessageSizeCalculator.outgoingAvatarSize = avatarSize
layout.photoMessageSizeCalculator.incomingAvatarSize = avatarSize
layout.photoMessageSizeCalculator.outgoingAvatarSize = avatarSize
// ... etc for all message types That's not to say that users couldn't just create an extension to do this, but if the maintenance cost is indeed low, why not just add to the API for a better dev experience? |
@ndonald2 do you how can i am align the bottom date to the right ? Without avatars |
@JulienLevallois please keep all discussions on topic Sent with GitHawk |
Its on the topic.. its about the avatar view |
@JulienLevallois Take a look at |
@JulienLevallois @SD10 , I've faced the same issues exposed by Julien and I've pushed a PR to fix this: #699 |
This issue has been marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This issue has been auto-closed because there hasn't been any activity for at least 21 days. However, we really appreciate your contribution, so thank you for that! 🙏 Also, feel free to open a new issue if you still experience this problem 👍. |
Now your can use |
Thanks for your reply @commando24 . In fact, this method has been deprecated since MessageKit 1.0:
But if you use the latest beta You can now directly use :
|
I should probably have checked this thread first. I was implementing the old delegate methods, and noticed they never get called. Duh. Ok. Then eventually found what @Artheyn said above.
|
Hey! nice pod) and if in func |
messagesCollectionView.messagesCollectionViewFlowLayout.setMessageOutgoingAvatarSize(.zero) |
I'm trying to hide the
AvatarView
with the new changes of 1.0.0-beta.1.Right now I use
avatarView.isHidden = true
inMessagesDisplayDelegate.configureAvatarView
which only hides the view but will not remove the space of theAvatarView
due to the size fromoutgoingAvatarSize
orincomingAvatarSize
ofMessageSizeCalculator
.Is it possible to change the value of
outgoingAvatarSize
orincomingAvatarSize
?I couldn't find any delegate callback or entry point for a subclass.
The text was updated successfully, but these errors were encountered: