有人可以告诉我最简单的方法来更改UITableView部分标题中文本的字体大小吗?
我使用以下方法实现了部分标题:
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
Run Code Online (Sandbox Code Playgroud)
然后,我了解如何使用此方法成功更改节标题高度:
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
Run Code Online (Sandbox Code Playgroud)
我使用此方法填充了UITableView单元格:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
Run Code Online (Sandbox Code Playgroud)
但是,我不知道如何实际增加部分标题文本的字体大小 - 或者字体样式?
有人可以帮忙吗?谢谢.
我正在开发一个不需要用户输入的应用程序,但我不希望iPhone进入省电模式.
是否可以禁用应用程序的省电功能?
在我的视图控制器代码中,我如何区分:
这两个presentingViewController和isMovingToParentViewController是YES在这两种情况下,所以都不是很有益的.
令我感到困惑的是,我的父视图控制器有时是模态的,在其上推送要检查的视图控制器.
事实证明我的问题是我将我HtmlViewController的UINavigationController内容嵌入了一个然后呈现的内容.这就是为什么我自己的尝试和下面的好答案都不起作用的原因.
HtmlViewController*     termsViewController = [[HtmlViewController alloc] initWithDictionary:dictionary];
UINavigationController* modalViewController;
modalViewController = [[UINavigationController alloc] initWithRootViewController:termsViewController];
modalViewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentViewController:modalViewController
                   animated:YES
                 completion:nil];
Run Code Online (Sandbox Code Playgroud)
我想我最好告诉我的视图控制器何时是模态,而不是试图确定.
objective-c uiviewcontroller uinavigationcontroller ios swift
我已经看到一些todo应用程序在午夜更新他们的应用程序徽章,始终显示正确的任务数量.他们这样做没有使用推送通知 - 所以我的问题是:他们是如何做到这一点的?他们是否使用本地通知 - 如果是,请在设备关闭时调用这些通知吗?我有点困惑,并会欣赏一些意见.
我知道使用UIDatePicker,您可以使用以下内容:
NSDate *myDate = picker.date;
Run Code Online (Sandbox Code Playgroud)
但我在我的视图中使用UIPickerView.我怎样才能同样获得选择的价值?或者我是否必须设置didSelectRow类型的方法来执行此操作?
更新:此代码适用于具有1个组件的选择器:
    NSInteger row;
    NSString *weightSelected;
    row = [repPicker selectedRowInComponent:0];
    weightSelected = [pickerArray objectAtIndex:row];
Run Code Online (Sandbox Code Playgroud)
我为这个带有2个组件的选择器累了这个代码,但它很冷:
    NSInteger row1, row2;
    NSString *weightSelected1;
    NSString *weightSelected2;
    row1 = [repPicker selectedRowInComponent:0];
    row2 = [repPicker selectedRowInComponent:1];
    weightSelected1 = [pickerArray objectAtIndex:row1];
    weightSelected2 = [pickerArray objectAtIndex:row2];
    NSString *weightSelected = [NSString stringWithFormat:@"%@.%@", weightSelected1, weightSelected2];
Run Code Online (Sandbox Code Playgroud) 好吧,我有几个UITextFields并且UITextViews在里面UIScrollView,我想设置键盘在scrollview触摸或滚动时消失(当然,当你在文本字段/视图内部触地时).
我目前尝试这样做是替换UIScrollView子类,并将其设置为在touchesBegan方法内调用removeKeyboard函数(在主视图控制器中定义).但是,这只会移除键盘以进行正常触摸,而不是仅在滚动视图时.那么,删除内部键盘的最佳方法是UIScrollView什么?
在此先感谢您的帮助.
当我使用Application Loader时,我到了要求我"选择..."要上传的文件的位置.
如果我理解正确,它应该是appName.app文件,我在我的应用程序包上的"产品"下看到(我右键单击它并选择"在Finder中显示"以获取库中的特定文件;然后我认为ZIP,我将在Application Loader中选择ZIP文件.首先,我是否正确这个假设?
如是...
我应该在XCode中定义什么不同于我用于构建测试应用程序的方式(在模拟器和我的个人iPhone上)?
我应该将Info --->命令行构建使用从Debug更改为Release吗?
我应该如何定义Build Settings ---> Code Signing部分(我应该在哪个字段中选择" iPhone Developer "选项,哪个应该是" iPhone Distribution ")?
是否还有其他重要的Info/Build Settings/p.list/etc ...字段?
任何帮助将不胜感激...
所以我有一个主要对象,它有许多与之相关的图像.图像也是一个对象.
假设您有一个集合视图控制器,并且在该控制器中
cellForItemAtIndexPath 
基于主要对象,如果它具有与之关联的当前图像,我想将selected设置为true.但我希望用户能够随时"取消选择"当前单元格以删除与主对象的关联.
我发现如果你设置"selected to true" - 如果主对象和图像之间存在关系cellForItemAtIndexPath,则取消选择不再是一个选项.
在
didDeselectItemAtIndexPath
Run Code Online (Sandbox Code Playgroud)
和
didSelectItemAtIndexPath
Run Code Online (Sandbox Code Playgroud)
我用日志测试它是否被调用.如果一个单元格设置为选中 -  nether被调用,但是如果我从未将单元格设置为选中,cellForItemAtIndexPath我可以选择并取消选择我想要的全部单元格.
这是集合视图应该工作的预期方式吗?我阅读了文档,似乎并没有谈到这一点.我解释文档意味着它的工作方式与表视图单元格相同.有一些明显的变化
这也表明控制器设置正确,并使用适当的委托方法....嗯
我刚刚在我的项目中添加了一个Watch应用程序并尝试:
override func awakeWithContext(context: AnyObject?) {
        super.awakeWithContext(context)
        let res =  WKInterfaceController.openParentApplication(["key" : "value"]) { (replyInfo, error) -> Void in
            print("replyInfo : \(replyInfo) + error \(error)")
        }
        print(res) // true here
    }
Run Code Online (Sandbox Code Playgroud)
在我的AppDelegate中,我写道:
func application(application: UIApplication, handleWatchKitExtensionRequest userInfo: [NSObject : AnyObject]?, reply: ([NSObject : AnyObject]?) -> Void) {
        reply(["replyKey" : "replyValue"]);
    }
Run Code Online (Sandbox Code Playgroud)
当我启动Watch应用程序时,我只有:
replyInfo:[:] + error可选(错误域= FBSOpenApplicationErrorDomain Code = 3"操作无法完成.(FBSOpenApplicationErrorDomain eor 3.)")
是由于模拟器?你知道做错了什么吗?
谢谢 !
我有一个带有几个IBOutlets的自定义单元类.我已将该课程添加到故事板中.我连接了所有的插座.我的cellForRowAtIndexPath函数如下所示:
override func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! {
        let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as SwipeableCell
        cell.mainTextLabel.text = self.venueService.mainCategoriesArray()[indexPath.row]
        return cell
    }
Run Code Online (Sandbox Code Playgroud)
这是我的自定义单元类:
class SwipeableCell: UITableViewCell {
    @IBOutlet var option1: UIButton
    @IBOutlet var option2: UIButton
    @IBOutlet var topLayerView : UIView
    @IBOutlet var mainTextLabel : UILabel
    @IBOutlet var categoryIcon : UIImageView
    init(style: UITableViewCellStyle, reuseIdentifier: String!) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
    }
}
Run Code Online (Sandbox Code Playgroud)
当我运行应用程序时,我的所有单元格都是空的.我已经注销self.venueService.mainCategoriesArray(),它包含所有正确的字符串.我也试过把一个实际的字符串等于标签,这会产生相同的结果.
我错过了什么?任何帮助表示赞赏.
ios ×9
objective-c ×4
swift ×4
cocoa-touch ×3
uitableview ×2
apple-watch ×1
ios8 ×1
ipa ×1
keyboard ×1
release ×1
storyboard ×1
uiscrollview ×1
upload ×1
watchkit ×1