{"id":135,"date":"2014-04-10T20:50:42","date_gmt":"2014-04-10T12:50:42","guid":{"rendered":"http:\/\/www.yusian.com\/blog\/?p=135"},"modified":"2020-12-01T13:12:48","modified_gmt":"2020-12-01T05:12:48","slug":"ios%e5%ae%9e%e6%88%98%e5%bc%80%e5%8f%91%e4%b9%8b%e4%bb%a3%e7%a0%81%e5%88%9b%e5%bb%bacell%ef%bc%88%e6%bc%94%e7%a4%ba%e6%96%b0%e6%b5%aa%e5%be%ae%e5%8d%9a%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.yusian.com\/blog\/project\/2014\/04\/10\/205042135.html","title":{"rendered":"ios\u5b9e\u6218\u5f00\u53d1\u4e4b\u4ee3\u7801\u521b\u5efaCell\uff08\u6f14\u793a\u65b0\u6d6a\u5fae\u535a\uff09"},"content":{"rendered":"<p><strong>1\u3001\u6548\u679c\u6f14\u793a<\/strong><\/p>\n<p><iframe height=480 width=320 src='https:\/\/player.youku.com\/embed\/XNjk3MDQyMDA4' frameborder=0 'allowfullscreen'><\/iframe><\/p>\n<p><strong>2\u3001\u8bbe\u8ba1\u8bf4\u660e<\/strong><br \/>\n2.0 \u8bbe\u8ba1\u8349\u56fe<!--more--><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.yusian.com\/blog\/wp-content\/uploads\/2016\/07\/1-10.png\" alt=\"1\" width=\"368\" height=\"388\" class=\"alignnone size-full wp-image-136\" \/><\/p>\n<p>2.1 \u6a21\u578b\u8bf4\u660e<br \/>\n2.1.1 SAWeibo\u7c7b\uff1a\u8be5\u7c7b\u4e3b\u8981\u529f\u80fd\u662f\u5c06\u57fa\u672c\u6570\u636e\u62bd\u8c61\u6210\u6570\u636e\u6a21\u578b\uff0c\u5c06\u6570\u636e\u5904\u7406\u601d\u60f3\u8f6c\u6362\u6210\u9762\u5411\u5bf9\u8c61\u7684\u7406\u5ff5\uff1b<br \/>\n2.1.2 SAWeiboFrame\u7c7b\uff1a\u8be5\u7c7b\u662f\u65b0\u589e\u52a0\u7684\u4e00\u4e2a\u7c7b\uff0c\u5c06\u5404\u89c6\u56fe\u5c3a\u5bf8\u4f4d\u7f6e\u7684\u8bbe\u7f6e\u5355\u72ec\u62bd\u8c61\u51fa\u6765\u521b\u5efa\u4e00\u4e2a\u89c6\u56fe\u6846\u67b6\u6a21\u578b\uff0c\u8be5\u6a21\u578b\u4e2d\u5305\u542b\u4e86\u6570\u636e\u6a21\u578b\uff0c\u7ed9\u6bcf\u6761\u5fae\u535a\u63d0\u4f9b\u6570\u636e\u6e90\u53ca\u5404\u5b50\u89c6\u56fe\u5b50\u63a7\u4ef6\u63d0\u4f9b\u4f4d\u7f6e\u4e0e\u5c3a\u5bf8\u670d\u52a1\uff1b<br \/>\n2.1.3 SAWeiboCell\u7c7b\uff1a\u8be5\u7c7b\u4e3b\u8981\u529f\u80fd\u662f\u521b\u5efaTableView\u4e2d\u6bcf\u4e2aCell\u7684\u5185\u5bb9\uff0c\u5305\u542b\u6570\u636e\u4e0e\u89c6\u56fe\uff0c\u56e0\u6b64\u5c06SAWeiboFrame\u6dfb\u52a0\u7ed9\u8be5\u7c7b\u7684\u4e00\u4e2a\u6210\u5458\u53d8\u91cf\uff0c\u8c03\u7528SAWeibo\u7c7b\u4e0eSAWeiboFrame\u7c7b\u5b8c\u6210\u5fae\u535a\u5c55\u793a\u529f\u80fd\uff1b<\/p>\n<p>2.2 \u57fa\u672c\u6b65\u9aa4<br \/>\n2.2.1 \u5220\u9664\u539f\u6709\u7684\u63a7\u5236\u5668\uff0c\u65b0\u5efa\u4e00\u4e2a\u63a7\u5236\u5668SAWeiboController\u76f4\u63a5\u7ee7\u627f\u81eaUITableViewController\uff0c\u5220\u9664storyboard\u4e2d\u7684view\uff0c\u65b0\u5efa\u4e00\u4e2aUITableView\u5e76\u5c06UITableView\u7684\u7c7b\u8bbe\u7f6e\u4e3a\u65b0\u521b\u5efa\u7684\u63a7\u5236\u5668<br \/>\n2.2.2 \u65b0\u5efa\u4e00\u4e2a\u7c7bSAWeiboCell\u7ee7\u627f\u81eaUITabeViewCell\uff0c\u8be5\u7c7b\u4e3b\u8981\u529f\u80fd\u57282.1 \u6a21\u578b\u8bf4\u660e\u4e2d\u5df2\u63cf\u8ff0\uff1b<br \/>\n2.2.3 \u5728\u63a7\u5236\u5668SAWeiboController\u4e2d\u5b9e\u73b0\u5fc5\u987b\u5b9e\u73b0\u7684\u51e0\u4e2a\u65b9\u6cd5\uff0c\u5982numberOfRowsInSection\u3001cellForRowAtIndexPath\u3001heightForRowAtIndexPath\u7b49\u65b9\u6cd5<br \/>\n2.2.4 \u5728\u5b9e\u73b0cellForRowAtIndexPath\u65b9\u6cd5\u524d\u9700\u8981\u521b\u5efaSAWeiboCell\u7c7b\uff0c\u5e76\u5728\u8be5\u7c7b\u4e2d\u5b9e\u73b0Cell\u521b\u5efa\u7684initWithStyle:reuseIdentifier:\u65b9\u6cd5\uff0c\u6dfb\u52a0cell\u5185\u90e8\u9700\u8981\u7684\u5b50\u63a7\u4ef6\uff08\u6b64\u65f6\u53ea\u7ba1\u6dfb\u52a0\u63a7\u4ef6\u6682\u4e0d\u5173\u5fc3\u63a7\u4ef6\u7684\u5c3a\u5bf8\u4e0e\u4f4d\u7f6e\uff09\uff1b<br \/>\n2.2.5 \u521b\u5efa\u6570\u636e\u6a21\u578bSAWeibo\u7c7b\uff0c\u589e\u52a0\u76f8\u5e94\u7684\u6570\u636e\u5c5e\u6027\uff1b<br \/>\n2.2.6 \u521b\u5efa\u89c6\u56fe\u6846\u67b6\u6a21\u578bSAWeiboFrame\u7c7b\uff0c\u589e\u52a0\u76f8\u5e94\u7684\u6570\u636e\u5c5e\u6027\u5e76\u5c06\u6570\u636e\u6a21\u578b\u8bbe\u7f6e\u6210\u8be5\u6a21\u578b\u7684\u5c5e\u6027\uff1b<br \/>\n2.2.7 \u91cd\u5199setWeibo\u65b9\u6cd5\uff0c\u5c06\u6570\u636e\u6a21\u578b\u8d4b\u503c\u7684\u540c\u65f6\u5c06\u6240\u6709\u5b50\u63a7\u4ef6\u7684\u5c3a\u5bf8\u4e0e\u4f4d\u7f6e\u8fdb\u884c\u8ba1\u7b97\u786e\u5b9a\u3001\u5c06\u5728\u6700\u540e\u8ba1\u7b97\u51fa\u6bcf\u4e2aCell\u7684\u9ad8\u5ea6<br \/>\n2.2.8 \u5c06\u8ba1\u7b97\u5f97\u51fa\u6765\u7684\u503c\u5206\u522b\u5199\u5230\u5404\u5c5e\u6027\u4e2d\uff0c\u56de\u5230\u63a7\u5236\u5668\u5b8c\u5584\u63a7\u5236\u5668\u672a\u5b8c\u6210\u7684\u914d\u7f6e\uff1b<br \/>\n2.2.9 \u5c06\u6570\u636e\u6a21\u578b\u8d4b\u503c\uff0c\u5c06\u89c6\u56fe\u6846\u67b6\u6a21\u578b\u8d4b\u503c\uff0c\u5e76\u5c06\u76f8\u5173\u5c5e\u6027\u7ed3\u679c\u56de\u5199\u5230numberOfRowsInSection\u3001cellForRowAtIndexPath\u3001heightForRowAtIndexPath\u65b9\u6cd5\u4e2d<\/p>\n<p>3\u3001\u6e90\u4ee3\u7801\u4e0b\u8f7d<\/p>\n<p>\u94fe\u63a5: <a href=\"http:\/\/pan.baidu.com\/s\/1gd431WB\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/pan.baidu.com\/s\/1gd431WB<\/a> \u5bc6\u7801: 5a6d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001\u6548\u679c\u6f14\u793a 2\u3001\u8bbe\u8ba1\u8bf4\u660e 2.0 \u8bbe\u8ba1\u8349\u56fe<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[14],"class_list":["post-135","post","type-post","status-publish","format-standard","hentry","category-project","tag-weibo"],"_links":{"self":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts\/135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/comments?post=135"}],"version-history":[{"count":0,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts\/135\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/media?parent=135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/categories?post=135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/tags?post=135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}