![](/img/trans.png)
[英]How can I reproduce the flick-to-scroll behavior of the iPhone UIScrollView in my own custom view?
[英]How can I implement my own custom MFMailComposeView?
最近,我一直在玩很多應用程序,而引起我注意的一個是盒子。 他們已經設法實現了自己的自定義MFMailComposeView。
正如您在下面看到的,他們已經在主體部分和主體部分中實現了自己的自定義棕色標題欄。 使用灰色文本添加了有關應用程序版本,ios版本和電話的元數據。 我該怎么做呢?
根本沒有任何風俗習慣。 導航欄的自定義外觀可能是使用UINavigationBar
的UIAppearance
代理進行的應用程序范圍內的設置。
電子郵件中顯示的文本只是使用HTML獲取文本顏色和行的預先填充的郵件正文。
所有這些都是使用標准API和標准MFMailComposeViewController
。
我在自己的應用中也是如此。
過於簡單:
mailViewController.navigationBar.tintColor = [UIColor purpleColor]; // whatever
[mailViewController setMessageBody:@"<hr /><p>Foo Bar</p>" isHTML:YES];
您必須自定義導航欄,即point1
self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:25.0f/255.0f green:60.0f/255.0f blue:106.0f/255.0f alpha:1.0f];
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"navigationbar.png"] forBarMetrics:UIBarMetricsDefault];
接下來設置您的foooter,可以通過編輯文本字體和頁腳內容來獲得灰色文本
注意*以下代碼是一個大概的想法
- (id)initWithSubject:(NSString *)subject body:(NSString *)body footer:(NSString *)footer{
//do the instaitatiaon check for nil
self.mailComposeDelegate = self;
[self setSubject:subject];
body = [NSString stringWithFormat:@"%@ %@", body, footer];
[self setMessageBody:body isHTML:YES];
return self;
}
希望這可以幫助你。
更好的是,您可以在可以自定義很多內容的地方添加html文本:)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.