Three20中给TTPhotoViewController添加播放按钮
by Elton on 2010年02月6日, under iPhone
Three20是一个很不错的iPhone类库,是facebook共享出来的框架。利用TTThumbsViewController可以很容易的制作出类似flickr的应用,实现缩略图和图片查看功能。
但是默认的TTThumbsViewController,点击一个图片的时候,下面的button只有上一个和下一个,并没有播放按钮。 之前以为Three20没有相应的播放功能。但是经过查看代码,发现在TTPhotoViewController中,其实有相关的方法,只是没有把播放按钮显示出来而已。
-
-
UIBarButtonItem* playButton = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:
-
UIBarButtonSystemItemPlay target:self action:@selector(playAction)] autorelease];
-
playButton.tag = 1;
-
通过修改TTPhotoViewController大致在400行左右,添加playButton这个变量
-
-
_toolbar.items = [NSArray arrayWithObjects:
-
space, _previousButton, space, playButton, space, _nextButton, space, nil];
-
这样重新编译后,就可以看到播放按钮了。
Three20这个库其实还是很实用的,只是文档比较欠缺,没办法,只能直接看源码了。
相关文章:



五月 24th, 2010 on 13:11
Good post, I like your website, thanks
八月 12th, 2010 on 04:15
Great post and website! I have bookmarked it and will check back ofter. I also linked you to my site.
八月 15th, 2010 on 18:57
Incredible submit which has received me considering in regards to the prospective of the idea. Genuinely truly remarkable.
八月 16th, 2010 on 03:41
A actually excellent publish by you my friend. I’ve bookmarked this page and will occur back following several days to examine for any new posts that you just make.
八月 22nd, 2010 on 11:33
Great post and website! I have bookmarked it and will check back ofter. I also linked you to my site.