我试图改变我的navBar中某些图标的大小,但我对如何做到这一点感到有点困惑?到目前为止我的代码是:
func setUpNavBarButtons() {
let moreButton = UIBarButtonItem (image: UIImage(named:"ic_more_vert_3")?.withRenderingMode(.alwaysOriginal), style: .plain, target: self, action: #selector(handleMore))
navigationItem.rightBarButtonItems = [moreButton]
let refreshButton = UIBarButtonItem (image: UIImage(named:"ic_refresh")?.withRenderingMode(.alwaysOriginal), style: .plain, target: self, action: #selector(refreshDataButton))
navigationItem.leftBarButtonItems = [refreshButton]
}
Run Code Online (Sandbox Code Playgroud)
任何帮助?
我正面临导航栏的问题。我正在添加searchController导航项的搜索控制器。
请参阅以下链接上的图片: 导航栏问题
脚步:
1)我在表格视图中有数据,当我点击单元格时,它是带有自定义导航视图的打开详细信息屏幕。这工作正常。(默认导航栏是隐藏的)
2)现在,我点击了搜索栏,然后点击了表格视图单元格。它向我显示了详细信息屏幕的默认导航栏。我不想显示默认导航栏。
我为实现搜索控制器而编写的代码如下:
searchController = UISearchController(searchResultsController: nil)
searchController.searchResultsUpdater = self
searchController.obscuresBackgroundDuringPresentation = false
searchController.searchBar.placeholder = "Search here..."
searchController.searchBar.tintColor = .white
searchController.searchBar.barTintColor = .white
if let textfield = searchController.searchBar.value(forKey: "searchField") as? UITextField {
textfield.textColor = UIColor.blue
if let backgroundview = textfield.subviews.first {
// Background color
backgroundview.backgroundColor = UIColor.white
// Rounded corner
backgroundview.layer.cornerRadius = 10;
backgroundview.clipsToBounds = true;
}
}
self.navigationItem.searchController = self.searchController
definesPresentationContext = true
Run Code Online (Sandbox Code Playgroud)
下面是在 didSelect 方法中隐藏导航栏的代码:
self.navigationController?.navigationBar.isHidden = true
self.navigationController?.isNavigationBarHidden = true
Run Code Online (Sandbox Code Playgroud) 插入后,该语句可与配合使用Oracle。
INSERT INTO table_name (col1, col2) VALUES (val1, val2) RETURNING col1 INTO :var ;
Run Code Online (Sandbox Code Playgroud)
我们可以将变量绑定到:var并执行该语句。
但是,当同一查询在Postgres数据库中运行时,会出现以下错误。
错误:“ INTO”处或附近的语法错误。
这种行为的原因是什么?
我试图在PL / pgSQL块中运行查询,它运行完美。
DO $$
DECLARE var integer;
BEGIN
INSERT INTO "table_name "(
"col1, "col2")
VALUES (val1, val2)
RETURNING "col1" INTO var;
END $$
Run Code Online (Sandbox Code Playgroud)
但是当我们连接到Postgres数据库时,上面的查询不能在没有PL / pgSQL块的情况下直接在C ++代码内部使用。我正在使用PostgreSQL 9.5.4。由于我们支持数据库不可知的软件应用程序,因此我们需要澄清这种行为。
我希望两个数据库都以相同的方式支持RETURNING .. INTO子句。
我不太了解有关订阅的信息.我有私人数据库.我创建了一个订阅表.如果我在一个iCloud帐户下订阅了两个设备,则会发生错误:订阅时出错:
CKError 0x165c6ac0:"服务器拒绝请求"(15/2032); server message ="订阅与'C6051A24-2DB5-47EA-98D2-7D8786AA6D3B'重复"; uuid = 48AC7472-006A-4FD7-84A9-DB342C83C199; container ID ="iCloud.com.*.*"
NSPredicate *truePredicate = [NSPredicate predicateWithValue:YES];
CKSubscription *itemSubscription = [[CKSubscription alloc] initWithRecordType:RecordType
predicate:truePredicate
options:CKSubscriptionOptionsFiresOnRecordCreation | CKSubscriptionOptionsFiresOnRecordUpdate];
CKNotificationInfo *notification = [[CKNotificationInfo alloc] init];
notification.shouldSendContentAvailable = YES;
notification.alertLocalizationKey = @"";
notification.shouldBadge = NO;
itemSubscription.notificationInfo = notification;
[self.privateDatabase saveSubscription:itemSubscription completionHandler
Run Code Online (Sandbox Code Playgroud)
也许我做错了什么?我需要对两台设备做什么才能收到订阅通知?
编辑:
也.我只创建一个订阅.如果我使用方法fetchAllSubscriptionsWithCompletionhandler,我会看到每个表的3-4个订阅.但这很奇怪,因为我只创造了一个.当我收到通知时,我会看到更多通知.
我正在尝试合并字符串数组\n,但没有得到任何解决方案.我有以下类型的数组,其中包含节名称.
let arrSectionName = [
"Section 1",
"Section 2",
"Section 3",
"Section 4",
"Section 5",
"Section 6",
]
Run Code Online (Sandbox Code Playgroud)
现在,我想从上面的数组中获取此字符串:
"第1节\n第2节\n第3节\n第4节\n第5节\n第6节"
所以最后消息应显示如下:
警报消息输出:
Following section which are still pending to complete, please verify and try again:
Section 1
Section 2
Section 3
Section 4
Section 5
Section 6
Run Code Online (Sandbox Code Playgroud)
节名称是动态的,将更改运行时和存储arrSectionName.
我已经在 iOS 和 Android 中集成了应用内购买(自动更新订阅)。两者都工作正常。我对使用跨平台验证 IAP 有一定的疑问,例如:
在一个应用程序中登录时有多位用户,一个特定的订阅如何运作?(例如,如果用户 A 有标准计划并在退出应用程序后。如果用户 B 登录具有高级计划的同一计划。iTunes 将如何管理特定用户的 IAP 计划?)
另外,如果用户在切换到 iOS 时拥有 android 设备,那么如何验证从 android 到 iOS 的 IAP,反之亦然?(像Netflix)
如果用户 A 在 android 上购买了标准计划,现在切换到 iOS 并升级到白金计划怎么办。那么在标准订阅计划结束时,标准计划会停止而白金会继续......还是标准计划也会被计算在内??
任何帮助将不胜感激。谢谢
我已UICollectionView在内部添加UITableViewCell,为此我创建了XIB文件。检查以下图片:
您可以在上图中看到所有视图的层次结构和约束。
注意:因为我想
UITableViewCell动态增加高度,所以我禁用了集合视图的垂直和水平滚动。因此,我已经采用了收集视图的高度约束的出口,并根据收集视图中可用的项目以编程方式对其进行了更改。
集合视图的项目大小(如果固定),宽度与集合视图成比例,高度为30
我已使用以下代码在我的表视图中注册了该xib。
self.tblSubCategory.register(SubCategoryTVC.Nib(), forCellReuseIdentifier: "SubCategoryTVC")
Run Code Online (Sandbox Code Playgroud)
这是我的代码SubCategoryTVC:
class SubCategoryTVC: UITableViewCell {
@IBOutlet weak var categoryView : UIView!
@IBOutlet weak var categoryImageView : UIView!
@IBOutlet weak var imgCategory : UIImageView!
@IBOutlet weak var lblCategoryName : UILabel!
@IBOutlet weak var cvSubcategory : UICollectionView!
// MARK: Constrains's Outlet
@IBOutlet weak var const_cvSubcategory_height : NSLayoutConstraint!
class func Nib() -> UINib {
return UINib(nibName: "SubCategoryTVC", bundle: nil)
}
func setCollectionView(dataSourceDelegate: UICollectionViewDataSource & …Run Code Online (Sandbox Code Playgroud) ios ×5
swift ×3
android ×1
arrays ×1
autolayout ×1
c++ ×1
cloudkit ×1
ios8 ×1
oracle ×1
postgresql ×1
string ×1
swift3 ×1
uitableview ×1
xcode ×1