小编Den*_*nov的帖子

无法在UITableView中重新排序行

尝试重新排序行时遇到问题UITableView.我有tableView:moveRowAtIndexPath:toIndexPath:触发的功能,但是fromIndexPath等于toIndexPath(即source == destination).我在这里看到了同样的问题:uitableview重新排序不起作用,源始终等于目标 但是解决方案是 - 使用不同的库.这不是我的变种.

- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
    //fromIndexPath is equal to toIndexPath, so nothing is exchaned
    [self.table_data exchangeObjectAtIndex:fromIndexPath.row withObjectAtIndex:toIndexPath.row];
}
Run Code Online (Sandbox Code Playgroud)

我的桌子处于可编辑模式,我已经 canMoveRowAtIndexPath:返回了YES.我没有用.怎么会?我究竟做错了什么?

objective-c uitableview ios

2
推荐指数
1
解决办法
1600
查看次数

Windows Phone图像网格"内存不足"错误

当我尝试显示图像网格时,我在Windows手机上有"内存不足"异常.我玩了一点代码,认为这Grid.Children.Add给了我那个错误.

我创建了自定义类,显示灰色矩形,加载图像后,它显示图像而不是该矩形.这里是:

   class ImageWIthLoader
   {
     private BitmapImage m_loader_bitmap;
     private BitmapImage m_source_bitmap;
     private Image m_image;

     public Image image
     {
         get { return m_image; }
     }

     //url - url to 120x120 image; width, height = 120 both
     public ImageWIthLoader(string url, int width, int height)
     {
         m_image = new Image();

         m_loader_bitmap = new BitmapImage(new Uri("Assets/Images/image_await_background.png", Uri Kind.Relative));
         m_loader_bitmap.DecodePixelWidth = width;
         m_loader_bitmap.DecodePixelHeight = height;

         m_image.Source = m_loader_bitmap;

         m_source_bitmap = new BitmapImage(new Uri(url));
         m_source_bitmap.CreateOptions = BitmapCreateOptions.None;
         m_source_bitmap.ImageOpened += bitmapLoaded;
     }

     private void bitmapLoaded(object …
Run Code Online (Sandbox Code Playgroud)

c# xaml out-of-memory windows-phone-8

0
推荐指数
1
解决办法
292
查看次数

UIView背景颜色与alpha在xib

我有个问题.我正在尝试使用图像放在我的自定义UIView中心.该图像外部的部分必须透明且呈灰色.在xib中为"View"我设置了这个:我的视图在xib中的设置

结果 - 失败.图像外的区域只是灰色,不透明.但如果我补充一下

-(void) viewDidLoad
{
  self.view.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5f];
}
Run Code Online (Sandbox Code Playgroud)

然后一切都按预期工作.尝试在xib中实现透明背景时,我做错了什么?

更新:我找到了正在进行视图呈现的代码,并且里面有alpha设置.所以我猜这就是问题所在.谢谢.很抱歉这么新手

xcode objective-c xib

0
推荐指数
1
解决办法
2058
查看次数

标签 统计

objective-c ×2

c# ×1

ios ×1

out-of-memory ×1

uitableview ×1

windows-phone-8 ×1

xaml ×1

xcode ×1

xib ×1