我有datetime "2016-11-24 11:59:56".如何在此日期添加一小时并将其与当前日期时间进行比较?
我试过了:
$date = "2016-11-24 11:59:56";
$date->addHour();
Run Code Online (Sandbox Code Playgroud) 当我触摸(Touch Up)一个UITableViewCell我的ViewController的UITableViewDelegate方法- (void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath被调用.此时我还需要获得Touch-Point的x坐标,以便我可以知道Cell的哪个部分被触摸(非附件物品).我尝试使用常见的触摸方法,如TouchesDidEnd,但无论我在哪里触摸,坐标总是返回x = 0.000 y = 0.000(在我的ViewController中的UITableView对象中的自定义UITableViewCell中的位置).我也尝试在Custom Cell类中实现触摸处理,虽然我可以获得准确的坐标,但我无法将这些坐标传递给我的ViewController类(它有UITableView).
问:当我触摸自定义UITableViewCell时,是否有一种很好的方法可以获得设备屏幕的x坐标?
我正在构建一个NS angular2应用程序,我遇到了TabView组件的默认行为的问题.我不希望它在创建组件时预加载所有数据.如何防止此行为发生.我只想在用户点击它时加载某个标签的数据.
这是我的tabview:
<TabView #tabview (selectedIndexChange)="onIndexChanged($event)" class="tab-view" sdkToggleNavButton>
<StackLayout *tabItem="{title: 'Summary', iconSource: 'res://ic_summary'}" >
<summary></summary>
</StackLayout>
<StackLayout *tabItem="{title: 'Dash', iconSource: 'res://ic_dashboard'}">
<dashboard></dashboard>
</StackLayout>
<StackLayout *tabItem="{title: 'My players', iconSource: 'res://ic_players'}" >
<myplayers></myplayers>
</StackLayout>
<StackLayout *tabItem="{title: 'Details', iconSource: 'res://ic_details'}" >
<playerdetails></playerdetails>
</StackLayout>
</TabView>
Run Code Online (Sandbox Code Playgroud)
我可以在tabview的相同.ts中调用onIndexChanged事件,但是我必须通知摘要,仪表板,内部组件.
需要通知的组件示例:
@Component({
selector: “summary”,
templateUrl: ‘summary.component.html’
})
export class SummaryView extends View {
constructor(args:Page){
super();
}
}
Run Code Online (Sandbox Code Playgroud) ios ×2
cocoa-touch ×1
delegates ×1
iphone ×1
javascript ×1
laravel ×1
laravel-5.3 ×1
mobile ×1
nativescript ×1
php ×1
php-carbon ×1
typescript ×1
uitableview ×1