IOS UITableView Highlight State when removing unit Gueyang
Last Update:2017-05-24
Source: Internet
Author: User
<span id="Label3"></p><p><p><span style="font-family: KaiTi_GB2312; font-size: 18px"><span><span></span></span></span></p></p> <blockquote style="line-height: 26px; border: 1px solid rgb(223,223,223); margin: 0px 5px; padding: 5px 10px; background-color: rgb(245,245,245); overflow: auto"> <p style="margin-top: 0px; margin-bottom: 0px; padding-top: 5px; padding-bottom: 5px; line-height: 28px; font-family: "Hiragino Sans GB", "Microsoft Yahei", "Helvetica Neue", Helvetica, Arial, sans-serif; border: 0px; text-indent: 22px"><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 5px; padding-bottom: 5px; line-height: 28px; font-family: "Hiragino Sans GB", "Microsoft Yahei", "Helvetica Neue", Helvetica, Arial, sans-serif; border: 0px; text-indent: 22px"><span style="font-family: KaiTi_GB2312; font-size: 18px; color: #ff00; line-height: 26px">Shimen The main contribution, respect the work of the author, please do not reprint.</span></p></p> <p><p></p></p> <p style="margin-top: 0px; margin-bottom: 0px; padding-top: 5px; padding-bottom: 5px; line-height: 28px; border: 0px; text-indent: 22px"><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 5px; padding-bottom: 5px; line-height: 28px; border: 0px; text-indent: 22px"><span style="color: #ff00; line-height: 26px"><span style="color: #777777; text-align: center"><span style="font-family: KaiTi_GB2312; font-size: 18px">Suppose the article is helpful to YOU. You are welcome to donate to the Author. Support Shimen master, Donate amount arbitrarily, heavy in mind ^_^</span></span><br></span></p></p> <p style="margin-top: 0px; margin-bottom: 0px; padding-top: 5px; padding-bottom: 5px; line-height: 28px; border: 0px; text-indent: 22px"><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 5px; padding-bottom: 5px; line-height: 28px; border: 0px; text-indent: 22px"><span style="line-height: 26px"><span style="text-align: center"><span style="font-family: KaiTi_GB2312; font-size: 18px"><span style="color: #777777">I want to donate:</span> <span style="color: #ff00">Click Donate</span></span></span></span></p></p> <p style="margin-top: 0px; margin-bottom: 0px; padding-top: 5px; padding-bottom: 5px; line-height: 28px; border: 0px; text-indent: 22px"><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 5px; padding-bottom: 5px; line-height: 28px; border: 0px; text-indent: 22px"><span style="color: #ff00; line-height: 26px"><span style="color: #777777; text-align: center"><span style="font-family: KaiTi_GB2312; font-size: 18px">Cocos2d-x source code download: dot I Teleport</span></span></span></p></p> </blockquote><br><p><p></p></p><p><p><span style="font-family: KaiTi_GB2312; font-size: 18px"><span><span>When working with the UITableView table, we want the user to interact with the touch cell format.</span></span></span></p></p><p><p><span style="font-family: KaiTi_GB2312; font-size: 18px"><span><span>But hopefully, after the user has finished interacting, the selected state of these cells can disappear.</span></span></span></p></p><p><p><span style="font-family: KaiTi_GB2312; font-size: 18px"><span><span>Cocoa Touch provides two ways to prevent a persistent selection of the cell back.</span></span></span></p></p><p><p><br><br><span>1.cell.selectionstyle = uitableviewcellselection</span> <span>Stylenone</span> <span>;</span><span><br></span></p></p><p><p><span style="font-family: KaiTi_GB2312; font-size: 18px"><span><span>The disadvantage of this method is that although the cell can be selected by the User. But will not be highlighted.</span></span></span></p></p><p><p><span style="font-family: KaiTi_GB2312; font-size: 18px"><span><span></span><br><span>2. Another way to agree to the unit highlighting display, but after the interaction is finished removing the highlighting.</span></span></span></p></p><p><p><span style="font-family: KaiTi_GB2312; font-size: 18px"><span><span>This requires a notification form to cancel the status of the Unit Cells.</span><span><br></span></span></span></p></p><p><p><span style="font-family: KaiTi_GB2312; font-size: 18px"><span><span>The code is as Follows:</span><br><br><span>-(void) Unselectcell</span> <span>:(id) sender{</span><br><span>[self.tableview deselectrowatindexpath:[self.</span> </span> <span>TableView</span> <span> <span>indexpathforselectedrow] animated:yes];</span><br><span>}</span><br><span>-(void) tableView: (uitableview *) tableView didselectrowatindexpath: (nsindexpath *) indexpath{</span><br><span>//</span> <span>jump and other operations</span> <span></span><br><span></span> <span>[self performselector: @selector (unselectcell:) withobject:nil afterdelay:0.5];</span><br><span>}</span></span></span></p></p><p><p><span style="font-size: 18px"><span style="font-family: KaiTi_GB2312">or call directly</span></span></p></p><p><p><span style="font-size: 18px"><span style="font-family: KaiTi_GB2312">[self.tableview Deselectrowatindexpath:indexpath animated:no];</span></span></p></p><p><p><br></p></p><p><p></p></p> <blockquote style="line-height: 26px; border: 1px solid rgb(223,223,223); margin: 0px 5px; padding: 5px 10px; background-color: rgb(245,245,245); overflow: auto"> <p style="margin-top: 0px; margin-bottom: 0px; padding-top: 5px; padding-bottom: 5px; line-height: 28px; font-family: "Hiragino Sans GB", "Microsoft Yahei", "Helvetica Neue", Helvetica, Arial, sans-serif; border: 0px; text-indent: 22px"><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 5px; padding-bottom: 5px; line-height: 28px; font-family: "Hiragino Sans GB", "Microsoft Yahei", "Helvetica Neue", Helvetica, Arial, sans-serif; border: 0px; text-indent: 22px"><span style="font-family: KaiTi_GB2312; font-size: 18px; color: #ff00; line-height: 26px">Shimen The main contribution, respect the work of the author, please do not reprint.</span></p></p> <p><p></p></p> <p style="margin-top: 0px; margin-bottom: 0px; padding-top: 5px; padding-bottom: 5px; line-height: 28px; border: 0px; text-indent: 22px"><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 5px; padding-bottom: 5px; line-height: 28px; border: 0px; text-indent: 22px"><span style="color: #ff00; line-height: 26px"><span style="color: #777777; text-align: center"><span style="font-family: KaiTi_GB2312; font-size: 18px">If the article is helpful to you, you are welcome to donate to the author, support the Shimen, donate any amount, ^_^</span></span><br></span></p></p> <p style="margin-top: 0px; margin-bottom: 0px; padding-top: 5px; padding-bottom: 5px; line-height: 28px; border: 0px; text-indent: 22px"><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 5px; padding-bottom: 5px; line-height: 28px; border: 0px; text-indent: 22px"><span style="line-height: 26px"><span style="text-align: center"><span style="font-family: KaiTi_GB2312; font-size: 18px"><span style="color: #777777">I want to donate:</span> <span style="color: #ff00">Click Donate</span></span></span></span></p></p> <p style="margin-top: 0px; margin-bottom: 0px; padding-top: 5px; padding-bottom: 5px; line-height: 28px; border: 0px; text-indent: 22px"><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 5px; padding-bottom: 5px; line-height: 28px; border: 0px; text-indent: 22px"><span style="color: #ff00; line-height: 26px"><span style="color: #777777; text-align: center"><span style="font-family: KaiTi_GB2312; font-size: 18px">Cocos2d-x source code download: dot I Teleport</span></span></span></p></p> </blockquote><span style="font-family: KaiTi_GB2312; font-size: 18px"><span style="font-family: KaiTi_GB2312; font-size: 18px"><span><span></span></span></span></span><p><p></p></p> <p><p>IOS UITableView Highlight State when removing unit Gueyang</p></p></span>