我一直在尝试为整个NavigationBar(不仅仅是titleView)设置自定义背景,但一直在努力.
我找到了这个帖子
http://discussions.apple.com/thread.jspa?threadID=1649012&tstart=0
但我不确定如何实现给出的代码片段.代码是作为新类实现的吗?另外我在哪里实例化,UINavigationController因为我有一个使用NavigationView模板构建的应用程序,所以它不是在我的根控制器中根据示例完成的
Android应用在onDeviceReady事件上返回无效大小(320x480),但几秒后大小变得正确.
我们怎样才能在一开始就获得正确的尺寸?或者是否有任何我可以获得正确尺寸的事件?
我正在使用此函数来获取大小:
function getWindowSizes() {
var windowHeight = 0, windowWidth = 0;
if (typeof (window.innerWidth) == 'number') {
windowHeight = window.innerHeight;
windowWidth = window.innerWidth;
} else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
windowHeight = document.documentElement.clientHeight;
windowWidth = document.documentElement.clientWidth;
} else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
windowHeight = document.body.clientHeight;
windowWidth = document.body.clientWidth;
}
return [windowWidth, windowHeight];
}
Run Code Online (Sandbox Code Playgroud)
视口:
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
使用Cordova 2.5.0.
UPD:
正如您在此屏幕截图中看到的那样,应用程序以较小的尺寸启动.即使是空的Cordova项目也是如此.我怎样才能解决这个问题?

谢谢!
我的iOS应用程序包含2个版本:服务器和客户端.服务器通过Bonjour发布服务并等待客户端.客户端搜索该服务并连接到服务器.之后所有通信都通过CFSockets实现.
以下是我为此类通信设置流的代码:
- (BOOL)setupSocketStreams {
if ( readStream == nil || writeStream == nil ) {
return NO;
}
incomingDataBuffer = [[NSMutableData alloc] init];
outgoingDataBuffer = [[NSMutableData alloc] init];
// Turning SSL on
NSDictionary *sslSettings = [NSDictionary dictionaryWithObjectsAndKeys:(id)kCFBooleanFalse, (id)kCFStreamSSLValidatesCertificateChain, nil];
CFReadStreamSetProperty(readStream, kCFStreamPropertySocketSecurityLevel, kCFStreamSocketSecurityLevelNegotiatedSSL);
CFReadStreamSetProperty(readStream, kCFStreamPropertySSLSettings, sslSettings);
CFWriteStreamSetProperty(writeStream, kCFStreamPropertySocketSecurityLevel, kCFStreamSocketSecurityLevelNegotiatedSSL);
CFWriteStreamSetProperty(writeStream, kCFStreamPropertySSLSettings, sslSettings);
CFReadStreamSetProperty(
readStream,
kCFStreamPropertyShouldCloseNativeSocket,
kCFBooleanTrue
);
CFWriteStreamSetProperty(
writeStream,
kCFStreamPropertyShouldCloseNativeSocket,
kCFBooleanTrue
);
CFOptionFlags registeredEvents =
kCFStreamEventOpenCompleted |
kCFStreamEventHasBytesAvailable |
kCFStreamEventCanAcceptBytes |
kCFStreamEventEndEncountered |
kCFStreamEventErrorOccurred
;
CFStreamClientContext ctx = {
0, …Run Code Online (Sandbox Code Playgroud)