我绝对无法调整我的大小UIWebView.
我UIWebView的声明是在.h和IB中连接的.IB中的高度是110.但是我的文本高度大约是1500.现在我想改变高度,这样全文就可以读取而不需要滚动.
什么代码调整了我UIWebView的内容webViewDidFinishLoad?找不到任何有效的东西.
基本上我想要一个自定义UINavigationBar.我不希望它是"半透明的"或任何东西,如图片应用程序.
我基本上想要完全删除它,但我仍然希望能够添加按钮,例如当按下导航控制器时,我希望将视图(EG :) UITableViewController推到它下面.
像这样:

任何想法如何实现这一点?
谢谢
我希望能够计算UIImage内存中使用的总字节数.
我可以通过将宽度乘以高度然后乘以乘数字节来进行粗略估计,但我想尽可能精确地计算尺寸.
如何使用导航控制器中的按钮推送视图?我试着效仿这个例子:http: //www.cimgf.com/2009/06/25/uitabbarcontroller-with-uinavigationcontroller-using-interface-builder/
这正是我需要的,我有一个UITabBarController4个标签,其中一个是UINavigationController.我想从第一个视图推送包含导航控制器的视图 - 这很简单UIView.它不起作用,我尝试使用以编程方式创建的按钮,没有任何反应.有什么指针吗?
这是我的代码
@interface HomeViewController : UIViewController {
}
-(IBAction)pushViewController:(id)sender;
@end
---
#import "HomeViewController.h"
#import "NewViewController.h"
@implementation HomeViewController
-(IBAction)pushViewController:(id)sender {
NewViewController *controller = [[NewViewController alloc] initWithNibName:@"NewViewController" bundle:nil];
[[self navigationController] pushViewController:controller animated:YES];
[controller release], controller = nil;
}
Run Code Online (Sandbox Code Playgroud)
这里也是连接的屏幕截图 http://imageshack.us/photo/my-images/847/screenshot20110719at620.png/
我已经尝试过你们建议但仍然没有,按钮(无论是创建Interface Builder还是编程)都表现得像是没有链接到任何方法.
我正在为iOS 4.2开发应用程序.我将子类UINavigationController插入两个UIImageView并使导航栏看起来是自定义的.一切都很好,但我有一点问题.我创建了自定义UIBarButtonItem和我的视图控制器内部我把它们:
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:backButton];
Run Code Online (Sandbox Code Playgroud)
它也有效,但问题是,为了完成这项工作,我需要调用它:
- (void)viewDidAppear:(BOOL)animated ;
Run Code Online (Sandbox Code Playgroud)
因此它只出现在动画之后,我可以看到非自定义按钮1秒钟,然后自定义按钮替换它.
(我试过viewWillAppear但在导航栏中没有任何附加内容)
我想知道你是否有解决方案可以解决这个问题.
PS:我从不使用IB,一切都是以编程方式制作的.
谢谢法国!
编辑1:这里的代码没有显示任何内容viewWillAppear:
- (void)viewWillAppear:(BOOL)animated {
[self setTitle:@"Jeu"];
//Bouton testflight
TIFButton *testFeedbackButton = [[TIFButton alloc]init];
[testFeedbackButton setTitle: @"Envoyer un Feedback" forState:UIControlStateNormal];
[testFeedbackButton addTarget:self action:@selector(launchFeedback) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *testFeedback = [[UIBarButtonItem alloc] initWithCustomView:testFeedbackButton];
self.navigationItem.rightBarButtonItem = testFeedback;
TIFBackButton *backButton = [[TIFBackButton alloc]init];
[backButton setTitle: @"Retour" forState:UIControlStateNormal];
[backButton addTarget:self action:@selector(popToPrecedentViewController) forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:backButton];
}
Run Code Online (Sandbox Code Playgroud) uinavigationbar uinavigationcontroller uibarbuttonitem viewdidappear ios
我有一张地图图片UIWebView.它默认加载在左上角.我希望它在中心初始化UIWebView.
有谁知道如何做到这一点?
谢谢!
我想保存NSMutableDictionary与NSUserDefaults.我在stackoverflow中读了很多关于这个主题的帖子......我还发现了一个有效的选项; 然而不幸的是它只工作一次然后它开始只保存(null).有人有提示吗?
谢谢
保存代码:
[[NSUserDefaults standardUserDefaults] setObject:[NSKeyedArchiver archivedDataWithRootObject:dictionary] forKey:@"Key"];
[[NSUserDefaults standardUserDefaults] synchronize];
Run Code Online (Sandbox Code Playgroud)
要加载的代码:
NSMutableDictionary *dictionary = [[NSMutableDictionary alloc]init];
NSData *data = [[NSUserDefaults standardUserDefaults]objectForKey:@"Key"];
dictionary = [NSKeyedUnarchiver unarchiveObjectWithData:data];
Run Code Online (Sandbox Code Playgroud)
将对象添加到的代码NSMutableDictionary:
[dictionary setObject:[NSNumber numberWithInt:0] forKey:@"Key 1"];
[dictionary setObject:[NSNumber numberWithInt:1] forKey:@"Key 2"];
[dictionary setObject:[NSNumber numberWithInt:2] forKey:@"Key 3"];
Run Code Online (Sandbox Code Playgroud)
代码到NSLog()值:
for (NSString * key in [dictionary allKeys]) {
NSLog(@"key: %@, value: %i", key, [[dictionary objectForKey:key]integerValue]);
}
Run Code Online (Sandbox Code Playgroud)
键也是(null):
NSLog(@"%@"[dictionary allKeys]);
Run Code Online (Sandbox Code Playgroud) 我有一个我想要MKMapView放大的中心位置以及一个位置列表(纬度/经度)。我想根据此位置列表设置缩放级别(距离),以便同时可以看到许多这些位置MKMapView,但具有最小缩放级别(或最大距离),以便我MKMapView不会缩放太多了。
假设我有一个包含 10 个位置的列表,但其中一个位置离我的中心位置太远,如果我显示其中的一个位置MKMapView将被缩小到很多,我该如何计算 的距离参数MKCoordinateRegionMakeWithDistance?
我希望我能很好地解释我的问题,我认为我很难解释它。
谢谢
索伦
当我初始化UITabBarController,每个标签包括UINavigationController各UINavigationController包括UIViewController
在当UIViewController我做这样的事情
TSActivityDetailsVC * c = [[TSActivityDetailsVC alloc] initWithNibName:@"TSActivityDetailsVC" bundle:nil];
[self.navigationController pushViewController:c animated:YES];
Run Code Online (Sandbox Code Playgroud)
我有动画,但当我按下后退按钮 - 我没有动画并得到错误
日志:
push view controller
Unbalanced calls to begin/end appearance transitions for <TSActivityMapVC: 0x81b1000>.
back btn pressed
Unbalanced calls to begin/end appearance transitions for <TSActivityDetailsVC: 0x81c85d0>.
Run Code Online (Sandbox Code Playgroud)
初始代码:
-(UITabBarController *) createMainTabBarController{
UITabBarController * tabbarCntr = [[UITabBarController alloc] init];
[tabbarCntr setViewControllers:[NSArray arrayWithObjects:
[[UINavigationController alloc] initWithRootViewController:[[TSActivityMapVC alloc] init]],
[[UIViewController alloc] init],
[[UIViewController alloc] init],
[[UIViewController alloc] init],
[[UIViewController alloc] …Run Code Online (Sandbox Code Playgroud) ios ×6
iphone ×6
xcode ×3
cocoa-touch ×2
uiwebview ×2
center ×1
height ×1
mkmapview ×1
objective-c ×1
sdk ×1
uiimage ×1
uitableview ×1