我有以下层次结构
public static RenderTargetBitmap GetReportImage(Grid view)
{
// Increased dimensions to increase image quality
Size size = new Size(view.ActualWidth * 2, view.ActualHeight * 2 );
// The dimensions that I want to convert back to.
_size = new Size(view.ActualWidth, view.ActualHeight);
if (size.IsEmpty)
return null;
RenderTargetBitmap result = new RenderTargetBitmap((int)size.Width, (int)size.Height, 96 , 96 , PixelFormats.Pbgra32);
DrawingVisual drawingVisual = new DrawingVisual();
using (DrawingContext context = drawingVisual.RenderOpen())
{
context.DrawRectangle(new VisualBrush(view), null, new Rect(new Point(), size));
context.Close();
}
result.Render(drawingVisual);
// Can I resize result to _size.Width and _size.Height?
return result;
}
我将scrollview的contentSize设置为比UITableViewCell
| UIView (cell's contentView)
| | UIScrollView
| | |UIView
| | | | some other views
中的scrollView本身更大的值,但有时它会保持初始值。 (我也是在AwakeFromNib()
。
我正在使用Autolayout和XCode 7 GM。故事板上没有约束问题。
知道问题可能来自哪里?