问题
My team is trying to design a mail client for lotus notes on iPad. Before we start I want to know if there is a third party custom MFMailComposeViewController
available. It should have To field just like Three20 MessageComposeViewController
(with the email address entered in round blue box). I want the same for Cc and BCc.
Not sure how I could extend the Three20 MessageComposeViewController
to add Cc, Bcc and use their delegate methods to send email request to my server.
回答1:
It is perfectly doable. I have subclassed TTMessageController before and added some image views to it, but from my experience it its not wise to go down that route. TTMessageController really isn't designed to be subclassed. So if I would do that again, I would copy TTMessageController and would edit it directly.
I don't know any other projects that provide this kind of UI. Are you using Three20 in that project anyways? Then TTMessageController might be a good fit. If you are not planning to use the rest of the library be warned: TTMessageController is quite deeply rooted in Three20. Ripping it out would be a pain. Rewriting from scratch might be easier.
About your question of how one could integrate CC and BCC fields into TTMessageController, that is hard to answer without a concrete question. I could only give some hints where to look.
To start the "To:" Field is a TTMessageRecipientField
. You might what to add additional fields of that class to the MessageController. A TTMessageRecipientField
contains a TTPickerTextField
through composition. The picker Text Field is the one that really does the work by communicating with the data Source of addresses, which simply is a TTTableDataSource and by displaying the blue bubbles (TTPickerViewCell
).
I hope that gives you an rough idea and some code to study.
来源:https://stackoverflow.com/questions/9045000/custom-mail-composer-just-like-three20-message-composer