本文整理汇总了TypeScript中ionic-angular.Content.scrollToBottom方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Content.scrollToBottom方法的具体用法?TypeScript Content.scrollToBottom怎么用?TypeScript Content.scrollToBottom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ionic-angular.Content
的用法示例。
在下文中一共展示了Content.scrollToBottom方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: ionViewDidEnter
//Function called once the view is full loaded
ionViewDidEnter() {
//Scroll to the bottom of the messages (Request below is for polling, not getting messages)
this.content.scrollToBottom(this.scrollDuration);
//Grab our user from localstorage
let user = JSON.parse(localStorage.getItem(AppSettings.shushItemName));
//Start polling to get messages
let poll = this.appMessaging.conversationRequestPoll(user.access_token);
//Get a reference to this
let self = this;
this.pollingRequest = poll.subscribe(function(success) {
//Success!
//Stop loading
self.appNotify.stopLoading().then(function() {
//Add our messages/Get our conversation
self.appMessaging.conversations = success;
//Update our conversations
self.updateConversation();
});
}, function(error) {
//Error!
//Stop Loading
self.appNotify.stopLoading().then(function() {
//Pass to Error Handler
self.appNotify.handleError(error, [{
status: 404,
callback: function() {
//Pop back to the All conversations view
self.navCtrl.pop();
}
}]);
});
}, function() {
//Completed
})
}
示例2: updateConversation
//Function to update our conversation
updateConversation() {
//Find and update our current conversation
for (let i = 0; i < this.appMessaging.conversations.length; ++i) {
if (this.convoId == this.appMessaging.conversations[i]._id) {
//Update the conversation
this.convo = this.appMessaging.conversations[i];
//Break from the loop
i = this.appMessaging.conversations.length;
}
}
//Update the UI
this.changeDetector.detectChanges();
//Scroll to the bottom of the messages
this.content.scrollToBottom(this.scrollDuration);
}
示例3: scrollToBottom
scrollToBottom(){
this.content.scrollToBottom(300);//300ms animation speed
}
示例4: ionViewDidEnter
ionViewDidEnter() {
this.content.scrollToBottom();
}