我怎样才能获得UITableViewCell
通过indexPath
?像这样:
我使用UIActionSheet
,当我点击确认UIButton
我想要更改单元格文本.
nowIndex我定义为一个属性
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex == 0)
{
NSInteger section = [nowIndex section];
NSInteger row = [nowIndex row];
NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease];
formatter.dateFormat = @"yyyy-MM-dd";
if (section == 0)
{
if (row == 0)
{
}
else if (row == 1)
{
UILabel *content = (UILabel *)[[(UITableView *)[actionSheet ] cellForRowAtIndexPath:nowIndex] viewWithTag:contentTag];
content.text = [formatter stringFromDate:checkInDate.date];
}
else if (row == 2)
{
}
} …
Run Code Online (Sandbox Code Playgroud) 我正在尝试UIViewController
从Nib文件创建一个.在Google上我发现我只能从Nib加载UIView.
但有些人建议我可以创建一个Nib文件(UIView),其文件所有者设置为我们的ViewController
.
这就是我做的,我没有崩溃,但视图没有显示.
编辑:试图viewcontroller
像这样推
self.navigationController!.pushViewController(CoolViewController(), animated: true );
Run Code Online (Sandbox Code Playgroud)
但它被推动时仍显示黑屏
XCode 6.3 - 不使用故事板
我刚看了WWDC视频(AVAudioEngine
实践中的会话502 )AVAudioEngine
,我非常高兴能够建立一个基于这种技术的应用程序.
我无法弄清楚如何对麦克风输入或调音台输出进行电平监控.
有人可以帮忙吗?为了清楚起见,我所说的是监控当前输入信号(并在UI中显示),而不是通道/轨道的输入/输出音量设置.
我知道你可以做到这一点AVAudioRecorder
,但是这不是AVAudioNode
它的AVAudioEngine
需要.
为什么我的自定义UIView
不在UIView
其父容器的容器内呈现?所以我拥有的是:
UIView
" customViewContainer
"(它不占用整个屏幕),和UIView
带有XIB文件的 - 它在UIView
这里呈现时(使用AspectFit)呈现在父" customViewContainer
" 的范围之外用于设置自定义视图的代码是MainViewController的提取:
"切 - 见下面的Update2"
所以我不明白为什么CustomView
视图以比父母更大的面积呈现customViewContainer
?我想要的是完全按照类型方法customview
适合父母" customViewContainer
" AspectFit
.
谢谢
编辑1(添加说明) - 如果我在父视图中"剪辑子视图"然后它会剪切内容,但我真正需要在父视图区域内渲染自定义视图(而不是整个屏幕区域).所以我需要(a)自定义视图的中心位于父视图的中心,以及(b)正确地将AspectFit视图放入父视图中.有任何想法吗?
编辑2 - 更新
抱歉 - 在原始问题中使用代码复制/粘贴错误 - 似乎无法编辑它所以我将在下面放置正确的版本 - 所以澄清:
MainViewController
- 有一个UIView
" containerView
"(它不占用整个屏幕),并且CustomView
- 是一个UIView
带有XIB文件 - 它在UIView
这里被渲染(带AspectFit
)渲染超出了父" containerView
" 的界限
使用下面的代码,这现在有意义吗?这个代码的原因是我有一个自定义UIView
,但我有一个与之关联的XIB文件,所以这是让我的MainController
视图能够使用它的唯一方法.也就是说,在容器视图中 …
我想检测UITableViewCell上的按钮点击,其中父UITableView由多个部分组成.
在单节的情况下,我能够做到这一点,但是在确定有多个部分的正确部分时遇到了麻烦.
我试图确定用户点击按钮的UITableViewCell对应的正确部分.
以下是问题解决后的更新代码:
@property (strong, nonatomic) NSMutableArray* quantityArray;
@property (strong, nonatomic) NSMutableArray* rows;
@synthesize quantityArray,rows;
- (void)viewDidLoad {
[super viewDidLoad];
quantityArray = [[NSMutableArray alloc] init];
[self PluMinusFunction];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
//
// Some code here.
//
if (addBtnClicked || minusBtnClicked) {
cell.lblCount.text = [[quantityArray objectAtIndex:indexPath.section-1]objectAtIndex:indexPath.row];
addBtnClicked = NO;
minusBtnClicked = NO;
} else {
cell.lblCount.text = [[quantityArray objectAtIndex:indexPath.section-1]objectAtIndex:indexPath.row];
}
cell.btnMinus.tag = indexPath.row;
cell.btnPlus.tag = indexPath.row;
cell.lblCount.tag = indexPath.row;
[cell.btnPlus addTarget:self action:@selector(addItem:) forControlEvents:UIControlEventTouchUpInside];
if ([ …
Run Code Online (Sandbox Code Playgroud) 我想使用iOS 7的新条形码扫描功能,UIImage
而不是从设备的相机中进行实时捕捉.我已经将检测工作正常了AVCaptureDeviceInput
.
我认为这样做是创建的具体子类,最好的方法AVCaptureInput
,提供媒体数据到AVCaptureSession
从UIImage
.但是,我找不到任何关于如何子类化的文档或示例AVCaptureInput
,所以我不知所措.
另一种方法是覆盖现有的媒体流AVCaptureDeviceInput
,但由于这些API是私有的,我想在App Store上发布我的应用程序,这并不理想.
最终,我可能最终会使用像ZXing或ZBar这样的第三方条形码库来实现这一点,但是在这里无法使用Apple的内置功能似乎是浪费.
我收到了苹果的电子邮件
1.0.1二进制被拒绝2015年6月16日17.2详细信息我们注意到您的应用使用Facebook登录进行身份验证,但不包括提供的基于帐户的功能
我得到了以下附件
来自Apple 17.2 - 要求用户共享个人信息的应用程序,如电子邮件地址和出生日期,以便运行将被拒绝17.2详细信息
我们注意到您的应用使用Facebook登录进行身份验证,但不包括该网站提供的基于帐户的功能,这在App Store中是不允许的.
下一步
请修改您的应用以包含该社交网络的基于帐户的功能或使用您自己的身份验证机制.
它背后的原因是什么?我研究了以下链接
https://www.parse.com/questions/app-rejected-facebook-login-doesnt-complete
我有iOS 8的问题autolayout
.
我想要一个UITableviewCell
带有a UILabel
和5 的自定义UIImageView
.我希望图像以横向模式显示,但不能以纵向模式显示,因为这样UILabel
会被挤压缩小.
我在界面构建器中设计了视图,并添加了以下约束(以及其他):
1. priority 1000: Label width >= 120px
2. priority 1000: ImageView[1..5]
horizontal space to next one = 0px (to align them next to each
other, the rightmost image view got horizontal space = 0 to content
view to align them to the right side)
3. priority 999: ImageView[1..5]
width = 40px
4. priority 998: ImageView[1..5] width = 0px (hide image
views if the 40px constraint …
Run Code Online (Sandbox Code Playgroud) 我希望UITextfield的键盘只有az,没有数字,没有特殊字符(!@ $!@ $ @!#),没有大写字母.基本上我打算只用字母表键盘.
我已经能够禁用空间了.任何人都知道如何禁用数字,特殊字符和大写字母?任何这些解决方案都很棒.
对于所有角色来说,这是最好的解决方案,但我不想要?
func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -> Bool {
if (string == " ") {
return false
}
if (string == "1") {
return false
}
return true
}
Run Code Online (Sandbox Code Playgroud) 我已经UIImageView
在里面使用了UITableViewCell
它将填充contentView.我已经尝试了不同的模式,如"Scale To Fill","Aspect Fit","Aspect Fill"到UITableViewCell里面的UIImageView.UITmageView里面的UIImageView已经用完了屏幕. Aspect Fill.我为图像设置了约束,如下所示
它工作正常如下
但是当图像尺寸太大时,它会显示出下面的问题,即它超出了单元边界
我使用
Aspect Fill
如下图所示
当我使用时,
Aspect Fit
我遇到了这个问题
当我使用时,
Scale To Fill
我遇到了这个问题
在
Aspect Fit
和Scale To Fill
我的左边和右边有余量如上图所示下面的链接不解决我的问题所以它不重复
UITableViewCell中的UIImageView没有得到更新
ios ×9
objective-c ×4
iphone ×3
uitableview ×3
autolayout ×2
avfoundation ×2
swift ×2
uiimageview ×2
uiview ×2
xcode ×2
addsubview ×1
barcode ×1
facebook ×1
ios7 ×1
ios8 ×1
macos ×1
nsindexpath ×1
xib ×1