Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/svn/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iphonesdk中的特殊TableView_Iphone_Ios_Xcode_Uitableview_Map - Fatal编程技术网

iphonesdk中的特殊TableView

iphonesdk中的特殊TableView,iphone,ios,xcode,uitableview,map,Iphone,Ios,Xcode,Uitableview,Map,如上所述,我在左侧有一个表视图,其中包含一些文本 但是,当我在地图中选择任何注释时,根据这一点,单元格将高亮显示&它的文本比其他单元格多,并且背景颜色也会改变 我如何才能做到这一点? 您需要为此自定义UITableViewCell 在视图中添加表视图和地图视图,如图所示 将自定义表格视图单元格加载到表格视图 最初为所有表格单元格指定所需的颜色 当用户选择单元格时,更改其颜色 使用didSelectRowAtIndexPath:delegate方法在地图上显示相应的值 检查此链接以获取教程:

如上所述,我在左侧有一个表视图,其中包含一些文本

但是,当我在地图中选择任何注释时,根据这一点,单元格将高亮显示&它的文本比其他单元格多,并且背景颜色也会改变

我如何才能做到这一点?

  • 您需要为此自定义
    UITableViewCell
  • 在视图中添加表视图和地图视图,如图所示
  • 将自定义表格视图单元格加载到表格视图
  • 最初为所有表格单元格指定所需的颜色
  • 当用户选择单元格时,更改其颜色
  • 使用
    didSelectRowAtIndexPath:
    delegate方法在地图上显示相应的值
  • 检查此链接以获取教程:

  • 您需要为此自定义
    UITableViewCell
  • 在视图中添加表视图和地图视图,如图所示
  • 将自定义表格视图单元格加载到表格视图
  • 最初为所有表格单元格指定所需的颜色
  • 当用户选择单元格时,更改其颜色
  • 使用
    didSelectRowAtIndexPath:
    delegate方法在地图上显示相应的值
  • 检查此链接以获取教程:


      • iOS中幻灯片菜单的基本示例


        希望此示例代码将帮助您了解iOS中幻灯片菜单的基本示例


        希望此示例代码能帮助您

        我认为您是在创建自定义注释,而不是默认注释,因此,如果您可以为每个注释视图设置与tableview单元格索引相同的标记。选择注释时,使用该标记创建indexpath,并为该indexpath设置selectedrow。希望能对您有所帮助。

        我认为您正在创建自定义注释,而不是默认注释,因此,如果您可以为每个注释视图设置标签,该标签将与tableview单元格索引相同。选择注释时,使用该标记创建indexpath,并为该indexpath设置selectedrow。希望它能对您有所帮助。

        您可以用以下方法进行处理。
        首先,表数据和地图中的注释引脚都是从数组中填充的!! 您可以做的是,将“标记”定义为特定项的数组索引。 当用户点击注释时,该注释有一个“标记”(或数组索引),该“标记”(或数组索引)也有一个表数据项。
        单击注释点击,您必须重新加载表格并突出显示特定的tableview单元格。

        您可以按照以下方式进行操作。
        首先,表数据和地图中的注释引脚都是从数组中填充的!! 您可以做的是,将“标记”定义为特定项的数组索引。 当用户点击注释时,该注释有一个“标记”(或数组索引),该“标记”(或数组索引)也有一个表数据项。 单击注释点击,您必须重新加载表格并突出显示特定的tableview单元格

      • 创建自定义的
        UITableViewCell
      • 了解您有两种情况A.正常单元格B.单击后的单元格
      • 您必须使用UITableView的3种委托方法来实现这一点

        - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
        {
            // Here you'll have to check for the condition you'll have to check which indexPath.row is selected. and according to that you'll have to change the height of your row.
             return hight;
        
        }
        
        
        - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
        {
             // Again the same thing. You'll have to check the condition and load the appropriate controls with appropriate frames.
        }
        
        - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
        {
             // This is the important function for you.
             // Here you'll have to set one counter. Which you'll use in the 
             // After that reload the table.
        }
        
      • 创建自定义的
        UITableViewCell
      • 了解您有两种情况A.正常单元格B.单击后的单元格
      • 您必须使用UITableView的3种委托方法来实现这一点

        - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
        {
            // Here you'll have to check for the condition you'll have to check which indexPath.row is selected. and according to that you'll have to change the height of your row.
             return hight;
        
        }
        
        
        - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
        {
             // Again the same thing. You'll have to check the condition and load the appropriate controls with appropriate frames.
        }
        
        - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
        {
             // This is the important function for you.
             // Here you'll have to set one counter. Which you'll use in the 
             // After that reload the table.
        }
        

        感谢您的回复。当我选择任何批注时,如何使用不同的自定义
        UITableViewCell
        &选项,根据将选择的单元格。@user1673099:选择批注时,请使用“selectRowAtindexPath”选项选择单元格,但当选择tableview单元格时,我可以调整其大小。@user1673099重新加载表格视图,并使用
        heightForRowAtIndexPath:
        delegate方法感谢回复。.我如何使用不同的自定义
        UITableViewCell
        &当我选择任何注释时,根据将选择的单元格。@user1673099:选择批注时,请使用“SelectRowatineXpath”选项选择单元格,但当选择表格视图单元格时,我可以调整其大小。@user1673099重新加载表格视图,并使用
        HeightForRowatineXpath:
        delegate方法但我如何调整单元格的大小选中和取消选中时。使用-(CGFloat)tableView:(UITableView*)tableView heightForRowAtIndexPath:(nsindepath*)indepath;委托方法。返回一个浮点值以更改行的大小,但在选中和未选中时如何调整单元格的大小。使用-(CGFloat)tableView:(UITableView*)tableView heightForRowAtIndexPath:(NSIndexPath*)indexPath;委托方法。返回浮点值以更改行的大小