本文整理匯總了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();
}