在ios13(使用iphone x)上,大标题导航不会覆盖状态栏,但是在滚动并过渡到传统导航栏时,它可以完美运行。没有缺口的设备不会受到影响。
它们全都嵌入在导航控制器中,所以我不知道为什么会这样。干杯
我试图显示字典格式的数据.下面,有三次尝试.首次尝试,输出顺序完全改变.第二次尝试,输出顺序与输入相同.但是,在第三次尝试中,我将变量声明为NSDictionary.我收到的确切输出.为什么这会改变字典?请指导我.我搜索了Swift的字典标签.但我找不到.
//First Attempt
var dict : Dictionary = ["name1" : "Loy", "name2" : "Roy"]
println(dict)
//output:
[name2: Roy, name1: Loy]
//Second Attempt
var dict : Dictionary = ["name2" : "Loy", "name1" : "Roy"]
println(dict)
//output:
[name2: Loy, name1: Roy]
-----------------------------------------------------------
//Third Attempt With NSDictionary
var dict : NSDictionary = ["name1" : "Loy", "name2" : "Roy"]
println(dict)
//output:
{
name1 = Loy;
name2 = Roy;
}
Run Code Online (Sandbox Code Playgroud)
另一个问题:我用游戏场进行验证.我的屏幕截图如下:

在这里,在NSDictionary中,我首先给了name5,但是在右边name2显示,然后,在println中,它以升序显示.为什么会这样?

在这里,在字典中,我给了name5作为第一个,但是在右边name2正在显示,然后,在println中,它正在显示它是如何在Dictionary行上拍摄的.为什么会这样?
我正在使用水平集合视图来滚动日期.集合视图包含30个单元格.如果我选择第一个单元格以指示选择,则单元格背景颜色已从默认颜色红色变为棕色.然后,如果我选择另一个单元格,则选定的单元格颜色已从红色变为棕色.但是第一个细胞BGColor保持不变(棕色).如何通过单击其他单元格更改为默认颜色?
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath
indexPath: NSIndexPath) -> UICollectionViewCell {
var cell = collectionView.dequeueReusableCellWithReuseIdentifier("cell",
forIndexPath: indexPath) as myViewCell
cell.date_label.text = arr_date[indexPath.item]
}
func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath
indexPath: NSIndexPath) {
var cell = collectionView.cellForItemAtIndexPath(indexPath) as myViewCell
if(cell.selected)
{
cell.backgroundColor = UIColor.brownColor()
}
else
{
cell.backgroundColor = UIColor.redColor()
}
}
Run Code Online (Sandbox Code Playgroud) 编辑:这是此 SDK 的确认错误
我正在使用Google Maps for iOS SDK的1.1.1.2311版本,我正在寻找屏幕上可见地图的边界纬度和经度坐标.
我正在使用以下代码告诉我当前的预测是什么:
NSLog(@"\n%@,%@\n%@,%@\n%@,%@\n%@,%@\n",
[NSNumber numberWithDouble:mapView.projection.visibleRegion.farLeft.latitude],
[NSNumber numberWithDouble:mapView.projection.visibleRegion.farLeft.longitude],
[NSNumber numberWithDouble:mapView.projection.visibleRegion.farRight.latitude],
[NSNumber numberWithDouble:mapView.projection.visibleRegion.farRight.longitude],
[NSNumber numberWithDouble:mapView.projection.visibleRegion.nearLeft.latitude],
[NSNumber numberWithDouble:mapView.projection.visibleRegion.nearLeft.longitude],
[NSNumber numberWithDouble:mapView.projection.visibleRegion.nearRight.latitude],
[NSNumber numberWithDouble:mapView.projection.visibleRegion.nearRight.longitude]);
Run Code Online (Sandbox Code Playgroud)
从阅读标题时,似乎相机移动时可能无法更新.很公平...
/**
* The GMSProjection currently used by this GMSMapView. This is a snapshot of
* the current projection, and will not automatically update when the camera
* moves. The projection may be nil while the render is not running (if the map
* is not yet part of your UI, or is …Run Code Online (Sandbox Code Playgroud) 我正在尝试语音识别样本.如果我开始通过麦克风识别我的演讲,那么我试图让iPhone听到那个公认的文字.这是工作.但是,声音太低了.你可以指导我吗?
而不是,如果我尝试简单的按钮操作,使用AVSpeechUtterance代码,音量是正常的.
之后,如果我选择startRecognise()方法,音量太低.
我的守则
func startRecognise()
{
let audioSession = AVAudioSession.sharedInstance() //2
do
{
try audioSession.setCategory(AVAudioSessionCategoryPlayAndRecord)
try audioSession.setMode(AVAudioSessionModeDefault)
try audioSession.setMode(AVAudioSessionModeMeasurement)
try audioSession.setActive(true, with: .notifyOthersOnDeactivation)
try AVAudioSession.sharedInstance().overrideOutputAudioPort(AVAudioSessionPortOverride.speaker)
}
catch
{
print("audioSession properties weren't set because of an error.")
}
recognitionRequest = SFSpeechAudioBufferRecognitionRequest()
guard let inputNode = audioEngine.inputNode else {
fatalError("Audio engine has no input node")
}
guard let recognitionRequest = recognitionRequest else {
fatalError("Unable to create an SFSpeechAudioBufferRecognitionRequest object")
}
recognitionRequest.shouldReportPartialResults = true
recognitionTask = speechRecognizer.recognitionTask(with: recognitionRequest, …Run Code Online (Sandbox Code Playgroud) avaudioplayer ios avspeechsynthesizer swift sfspeechrecognizer

当我尝试在我的设备中运行应用程序时,我收到此警告。请指导我如何解决这个问题。我正在尝试过去两天。我做不到。复制符号文件在状态栏中。进度视图也未加载。我在堆栈溢出中提到了一些答案。但是,还没有解决。我不知道该怎么办?请指导我。
设备在我的 iMAC 中工作:
Xcode 6.3 版 iOS 8.2 版
另一个 MAC BOOK PRO 的相同设备:
设备不能与另一个 MAC BOOK PRO 一起使用。所以我们遵循了以下步骤。
1 . 操作系统升级到 8.3,并在同一天,通过按照程序创建新证书,该设备连接到另一个 MAC Book Pro。
2 . 收到错误,如版本不支持 XCode
3 . 于是我们将 Xcode 升级到 6.4,iOS 8.3,在另一台 MAC 上成功运行。
4 . 现在,在我的 iMAC 中,版本更新为 XCode 6.4 和 iOS 版本 8.3。
从那天开始,如果我尝试在设备中运行,我将无法运行。复制符号文件错误仅接收。但是在 MAC BOOk PRO 中工作。
请帮助我。如何解决这个问题?
在我的Swift应用程序中,我不知道如何在UISegmentControl中单独更改选定段的BGColor.我尝试了很多,只有色调正在改变.我在Objective - C中取得了成功.我不知道如何将其转换为SWIFT.请指导我.我的编码如下:
目标C.
- (IBAction)mySeg:(UISegmentedControl *)sender {
for (int i=0; i<[sender.subviews count]; i++)
{
if ([[sender.subviews objectAtIndex:i]isSelected] )
{
UIColor *tintcolor=[UIColor colorWithRed:255.0/255.0 green:0/255.0 blue:0/255.0 alpha:1.0];
[[sender.subviews objectAtIndex:i] setTintColor:tintcolor]; //HERE SELECTED SEGMENT COLOR ALONE CHANGING
}
else
{
[[sender.subviews objectAtIndex:i] setTintColor:nil];
}
}
}
Run Code Online (Sandbox Code Playgroud)
迅速
@IBAction func mySegAcn(sender: UISegmentedControl) {
for(var i : Int = 0; i < sender.subviews.count; i++)
{
if((sender.subviews[i].isSelected) != nil)
{
//var tint_Color = UIColor(red: 1.0, green: 0, blue: 0, alpha: 1.0)
(sender.subviews[i] as! UIView).tintColor = …Run Code Online (Sandbox Code Playgroud) 嗨,我在ViewController中有TabBar。我想在单击侧面菜单按钮时显示侧面菜单视图。我正在从右到左为视图设置动画。工作正常。但是,当这样做时,标签栏会隐藏侧面菜单视图的底部。所以我试图隐藏标签栏。但是,那里仍然有空白。我不知道如何删除该空白。我已经在侧面菜单视图中使用了约束。请指导我。
当我们尝试在同一视图控制器中隐藏标签栏时,我面临着这个空白问题。
请指导我。
我的密码
@IBAction func sideMenu_Acn(sender: UIButton) {
self.SM_left_Constrain.constant = 0
tabBarController.tabBar.hidden = true
UIView.animateWithDuration(0.8) {
self.view.layoutIfNeeded()
}
}
Run Code Online (Sandbox Code Playgroud)
如何使用google maps sdk为iOS设置区域?我想设置缩放位置和标记半径.
我试图在 swift 中使用可扩展的 tableview。所以我在tableview的标题中添加了Gesture,但它无法识别。请指导我。只需交叉检查我的编码。
我的编码如下:
func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let vvv = tableView.headerViewForSection(section)
let tap = UITapGestureRecognizer(target: self, action: Selector("handleTap:"))
tap.delegate = self
vvv?.addGestureRecognizer(tap)
return vvv
}
func handleTap(gestureRecognizer: UITapGestureRecognizer)
{
if(gestureRecognizer.state == .Ended)
{
println("SECTION PRESSED") //NOT ENTERING TO THIS BLOCK
}
}
Run Code Online (Sandbox Code Playgroud) 我是新来的NativeScript。我正在遵循自己的文件。我正在尝试UI对齐。我无法实现这一目标。我正在使用Xcode IDE并在中运行iOS Simulator。
杂货徽标应位于顶部
文字栏位应在中间
注册按钮应该在底部
尝试1
<Page loaded="loaded">
<GridLayout height=auto horizontalAlignment="center" verticalAlignment="center" columns="*" rows="auto,auto,*" backgroundColor="brown">
<Image src="res://logo" stretch="aspectFit" horizontalAlignment="center" verticalAlignment="top" col="0" row="0"></Image>
<GridLayout columns="*" rows="auto,auto,auto" verticalAlignment="center" backgroundColor="lightgray" col="0" row="1">
<TextField class="userTxtFld" id="email" text="{{ email }}" hint="Email Address" keyboardType="email" autocorrect="false" autocapitalizationType="none" col="0" row="0"/>
<TextField secure="true" text="{{ password }}" hint="Password" col="0" row="1"/>
<Button text="Sign in" tap="signIn" col="0" row="2"/>
</GridLayout>
<Button text="Sign up for Groceries" class="link" tap="register" verticalAlignment="bottom" col="0" row="2"/>
</GridLayout>
</Page>
Run Code Online (Sandbox Code Playgroud)
尝试2
<Page loaded="loaded">
<GridLayout …Run Code Online (Sandbox Code Playgroud) 我是新来的 Flutter
我正在尝试更改FlatButton文本onPressed。我的页面设计中分离Widget的方法,所以无法添加setState()中onPressed。
我已经搜索了很多。但是,找不到。请帮我解决这个问题。
import 'package:flutter/material.dart';
int number = 10;
class SecondRoute extends StatelessWidget {
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text('Lists'),
backgroundColor: new Color(0xFF000000),
),
body: DynamicChange(),
);
}
}
class DynamicChange extends StatefulWidget {
@override
StateDynamic createState() => StateDynamic();
} // Class SecondRoute
class StateDynamic extends State<DynamicChange> {
Widget build(BuildContext context) {
return new Scaffold(
body: thisScreenNeeds(),
);
}
}
Widget thisScreenNeeds() …Run Code Online (Sandbox Code Playgroud) 我正在尝试聊天应用程序。聊天工作正常。面临一些 UI 问题。
1.我正在使用标签的自动布局。所以根据消息大小自动标签获取扩展。但是,我在 UITableViewCell 中有标签。我无法动态计算行高。
我的代码:
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
CGSize textSize = {268, CGFLOAT_MAX};
CGSize size = [message sizeWithFont:[UIFont fontWithName:@"Helvetica Neue" size:14] constrainedToSize:textSize lineBreakMode:NSLineBreakByWordWrapping];
CGFloat height = size.height < 65 ? 65 : size.height;
return height;
}
Run Code Online (Sandbox Code Playgroud)
我的标签子类代码
- (void)drawTextInRect:(CGRect)rect
{
self.textInsets = UIEdgeInsetsMake(5, 5, 5, 5);
return [super drawTextInRect:UIEdgeInsetsInsetRect(rect, self.textInsets)];
}
- (CGSize) intrinsicContentSize
{
self.textInsets = UIEdgeInsetsMake(5, 5, 5, 5);
CGSize superSize = [super intrinsicContentSize] ;
superSize.height += self.textInsets.top + self.textInsets.bottom ;
superSize.width += self.textInsets.left …Run Code Online (Sandbox Code Playgroud) swift ×8
ios ×4
ios8 ×3
objective-c ×2
uitableview ×2
dart ×1
flutter ×1
google-maps ×1
grid-layout ×1
nativescript ×1
nsdictionary ×1
xcode6 ×1
xml ×1