Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* Adjusted font size of web view title

git-svn-id: http://naan.net/svn/trunk/TwitterFon@1157 542e9493-1a22-0410-9183-c10453d2b9ee
  • Loading branch information...
commit c370cdaaae3d82de3d97df1f3ecefb560a66a1bd 1 parent 6d1d2ab
kaz authored
View
1  Classes/Controllers/WebViewController.h
@@ -12,6 +12,7 @@
@interface WebViewController : UIViewController {
IBOutlet UIWebView* webView;
IBOutlet UIButton* button;
+ IBOutlet UILabel* titleLabel;
IBOutlet UIBarButtonItem *backButton;
IBOutlet UIBarButtonItem *forwardButton;
View
13 Classes/Controllers/WebViewController.m
@@ -41,7 +41,8 @@ - (void)viewDidLoad
button.contentEdgeInsets = UIEdgeInsetsMake(0, 5, 0, 5);
tinyURLStore = [[NSMutableDictionary alloc] init];
-
+ titleLabel.font = [UIFont systemFontOfSize:16];
+
}
- (void)viewWillAppear:(BOOL)animated
{
@@ -57,15 +58,19 @@ - (void)viewDidAppear:(BOOL)animated
if (animated) {
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
- self.title = url;
+ titleLabel.text = url;
[self setUrlBar:url];
}
+
+ self.navigationController.navigationBar.topItem.titleView = titleLabel;
+
}
- (void)viewWillDisappear:(BOOL)animated
{
[webView stopLoading];
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
+ self.navigationController.navigationBar.topItem.titleView = nil;
}
- (void)viewDidDisappear:(BOOL)animated
@@ -125,7 +130,7 @@ - (BOOL)webView:(UIWebView *)aWebView shouldStartLoadWithRequest:(NSURLRequest *
NSString *aURL = [request.mainDocumentURL absoluteString];
- self.title = aURL;
+ titleLabel.text = aURL;
[self setUrlBar:aURL];
for (int i = 0; i < NUM_SCHEMES; ++i) {
@@ -154,7 +159,7 @@ - (void)webViewDidFinishLoad:(UIWebView *)aWebView
{
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
// Remove all a tag target
- self.title = [aWebView stringByEvaluatingJavaScriptFromString:
+ titleLabel.text = [aWebView stringByEvaluatingJavaScriptFromString:
@"try {var a = document.getElementsByTagName('a'); for (var i = 0; i < a.length; ++i) { a[i].setAttribute('target', '');}}catch (e){}; document.title"];
NSURL *aURL = aWebView.request.mainDocumentURL;
View
61 WebView.xib
@@ -2,12 +2,13 @@
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.02">
<data>
<int key="IBDocument.SystemTarget">512</int>
- <string key="IBDocument.SystemVersion">9E17</string>
- <string key="IBDocument.InterfaceBuilderVersion">670</string>
- <string key="IBDocument.AppKitVersion">949.33</string>
+ <string key="IBDocument.SystemVersion">9F33</string>
+ <string key="IBDocument.InterfaceBuilderVersion">672</string>
+ <string key="IBDocument.AppKitVersion">949.34</string>
<string key="IBDocument.HIToolboxVersion">352.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="21"/>
<integer value="9"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
@@ -111,6 +112,38 @@
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
</object>
+ <object class="IBUILabel" id="414887699">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrameSize">{320, 21}</string>
+ <reference key="NSSuperview"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <bool key="IBUIUserInteractionEnabled">NO</bool>
+ <string key="IBUIText">Label</string>
+ <object class="NSColor" key="IBUITextColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">alternateSelectedControlTextColor</string>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ </object>
+ <nil key="IBUIHighlightedColor"/>
+ <object class="NSColor" key="IBUIShadowColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">alternateSelectedControlColor</string>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MCAwIDEAA</bytes>
+ </object>
+ </object>
+ <int key="IBUIBaselineAdjustment">1</int>
+ <float key="IBUIMinimumFontSize">1.300000e+01</float>
+ <int key="IBUITextAlignment">1</int>
+ </object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
@@ -188,6 +221,14 @@
</object>
<int key="connectionID">20</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">titleLabel</string>
+ <reference key="source" ref="841351856"/>
+ <reference key="destination" ref="414887699"/>
+ </object>
+ <int key="connectionID">25</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -261,6 +302,12 @@
<reference key="object" ref="1044481674"/>
<reference key="parent" ref="317696112"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">21</int>
+ <reference key="object" ref="414887699"/>
+ <reference key="parent" ref="957960031"/>
+ <string key="objectName">TitleView</string>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -271,6 +318,8 @@
<string>-2.CustomClassName</string>
<string>2.IBEditorWindowLastContentRect</string>
<string>2.IBPluginDependency</string>
+ <string>21.IBEditorWindowLastContentRect</string>
+ <string>21.IBPluginDependency</string>
<string>3.IBPluginDependency</string>
<string>4.IBPluginDependency</string>
<string>6.IBPluginDependency</string>
@@ -283,6 +332,8 @@
<string>UIResponder</string>
<string>{{507, 862}, {320, 460}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>{{1234, 1285}, {320, 21}}</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@@ -310,7 +361,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">20</int>
+ <int key="maxID">25</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -349,6 +400,7 @@
<string>backButton</string>
<string>button</string>
<string>forwardButton</string>
+ <string>titleLabel</string>
<string>webView</string>
</object>
<object class="NSMutableArray" key="dict.values">
@@ -356,6 +408,7 @@
<string>UIBarButtonItem</string>
<string>UIButton</string>
<string>UIBarButtonItem</string>
+ <string>UILabel</string>
<string>UIWebView</string>
</object>
</object>
Please sign in to comment.
Something went wrong with that request. Please try again.