English 中文(简体)
我如何确定在习惯“可调用的电文”中的位置。
原标题:how do I set the size/position of a custom UIView for its placing within a custom UITableViewCell?

我如何确定一个分调查的规模,该次调查正在从方案上排在可转让的电文中?

我有一套习惯(下级)可调电的电文,其中部分电池包括一些行文(动力学),这些行文是作为“质询”。 想法是形成习惯观点(这是物品的排数),然后当UITableViewCell打上了布局表时,它将(a) 确立自己的位置,(b) 穿透并称之为它用于各行各行的海关数据。

<问——我不敢确定如何正确确定“IDView”的大小/位置? 我如何在习俗调查中确定其X、y、width、hala,以便我能够定位?

举例来说,我是否确实需要人工操作,采用UITableCellView的排他性调查方法,穿过所有各行,并采用一种习惯方法,通过他们需要的位置/地点/时间? 当时,当海关调查组的定点排外调查方法受到打击时,它会知道,它会发现储存这些价值以使用这些价值的各种实例吗?

希望这样做是有意义的。

结构:

<>Dynamic Customs UITableCellView(下级)

  • determines rowHeight dynamically in heightForRowAtIndexPath
  • in layoutSubviews it includes looping through subviews (of custom UIView I have) and calls layoutSubview on each of these

www.un.org/Depts/DGACM/index_spanish.htm 在《海关调查》中(代表一系列物品,例如:国际劳工局)。

  • in layoutSubview - QUESTION: How do set the size of the frame of this subview?
  • I assume the x,y for the frame should be 0,0?
  • For the width/height how do you get the full size of the superview area to which it should set in?
  • Should the superview have passed this information down to it prior to the layoutSubviews?
最佳回答

any views added as part of the tableViewCell subclass are positioned relative to the cells frame, ie x:0,y:0 for the subview origin, would be the top left corner of the tableCell. Something like this should be enough to get you started.

CGRect frame =[self frame];
frame.size.height=20.0f;
frame.origin.x=(self.frame.size.height/2)-frame.size.height;
frame.origin.y=0.0f;
[subview setFrame:frame];
问题回答

你可以在《国际不动产合同法》中增加一个类别,采用转售方法。

UIView+ResizeMethods.h

- (void) setHeight: (CGFloat) height;
- (void) setWidth: (CGFloat) width;
- (void) setTop: (CGFloat) top;
- (void) setLeft: (CGFloat) left;

UIView+ResizeMethods.m

- (void) setHeight: (CGFloat) height {
    CGRect frame = self.frame;
    frame.size.height = height;
    self.frame = frame;
}
- (void) setWidth: (CGFloat) width {
    CGRect frame = self.frame;
    frame.size.width = width;
    self.frame = frame;
}
- (void) setTop: (CGFloat) top {
    CGRect frame = self.frame;
    frame.origin.y = top;
    self.frame = frame;
}
- (void) setLeft: (CGFloat) left {
    CGRect frame = self.frame;
    frame.origin.x = left;
    self.frame = frame;
}




相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签