简体   繁体   English

如何在Ipod中创建可编辑列表,例如播放列表?

[英]How to create a editable list like the playlist in Ipod?

In my Iphone App,which is a multiple view application using arc and storyboard, i want to create a editable list, like the playlist in the iphone's integrated ipod. 在我的iPhone应用程序(这是一个使用弧线和情节提要的多视图应用程序)中,我想创建一个可编辑列表,例如iphone集成ipod中的播放列表。 when i click on the edit button there should be little red '-' images left of the items texts and there also should appear a '+' button on the navigation bar where i can add new items to the list. 当我单击“编辑”按钮时,项目文本左侧应该有少量红色“-”图像,并且在导航栏上还应显示一个“ +”按钮,我可以在其中添加新项目。

You see it should be similar to the playlists in the ipod. 您会看到它应该类似于ipod中的播放列表。 Does anybody knows any tutorial about that or something else? 有人知道关于此的教程或其他吗? I googled for 2 hours but found nothing -.- 我用Google搜索了2个小时,但什么都没找到-.-

I would be very happy if you can help me with this 如果您能帮助我,我将非常高兴

Thanks 谢谢

If you are using the lastest Xcode, try making a 'Master Detail' application. 如果您使用的是最新的Xcode,请尝试制作“ Master Detail”应用程序。

That should provide with you with basic editing functionality in a UITableView . 这应该为您提供UITableView基本编辑功能。

Use a UITableView , for the small '-' and the '+' you can create buttons with the intended task as actions. 使用UITableView ,对于小的“-”和“ +”,您可以创建将预期任务作为操作的按钮。 If you want the specific red '-' buttons then I think they are available in the ios sdk. 如果您想要特定的红色“-”按钮,那么我认为它们可以在ios SDK中使用。

The '+' and '-' signs are accessories for the tableViewCell . “ +”和“-”符号是tableViewCell附件。 So to set them, you need to set the accessoryType property of the UITablewViewCell . 因此,要设置它们,你需要设置accessoryType的财产UITablewViewCell If you look at the class reference, there's a list of them, including the buttons. 如果您查看类参考,则会有它们的列表,包括按钮。 What I would also do is have a bool value for each cell, and have the accessoryType be '+' or '-' depending on the value of the bool, and have the value itself change every time the user touches the cell. 我还要做的是什么有每个小区的布尔值,并有accessoryType是“+”或“ - ”这取决于布尔值,并有本身的价值改变每用户触摸电池时间。 That way the sign will switch every time a cell is touched, and at the end you can go through and save or discard the things in each cell based on it's bool value. 这样,每次触摸一个单元格时,符号都会切换,最后,您可以根据其布尔值浏览并保存或丢弃每个单元格中的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM