2014-11-24 62 views
0

我有一个webview和我使用自定义字体(都在web视图和本地控件)。 但是,当我打开HTML下拉字体呈现的是iOS默认字体。 为了解释这更好的,html元素有这样的事情:UIWebView选择元素选项字体

<select style="font-family:myfont"> 
    <option value="1">option 1</option> 
    <option value="2">option 2</option> 
    <option value="3">option 3</option> 
    <option value="4">option 4</option> 
</select> 

当降元件被点击的网页视图中打开本地UIPopoverController与包含值的表。该表具有默认字体。

我该如何改变它?

我已经尝试使用外观代理,它不受支持。

[[UILabel appearance] setFont:[UIFont fontWithName:kFont_Regular size:18.0]]; 

这里的问题是,我没有一个tableview可以实现“cellForRowAtIndexPath”方法。我可以重写该控件吗?

有没有一种方法来设置全局使用的默认UITableViewCell?

在此先感谢。

回答

1

不幸的是,目前还没有办法在全球范围内做到这一点。我必须在cellForRowAtIndexPath方法中执行如下操作。

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    static NSString *simpleTableIdentifier = @"SimpleTableCell"; 

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier]; 

    if (cell == nil) { 
     cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier]; 
     [cell.textLabel setFont:[UIFont fontWithName:@"My_FontName" size:17]]; 
    } 

... 
}