setTranslationY()

Sets the vertical location of this view relative to its top position. This effectively positions the object post-layout;
設置這個控件相對於其頂部位置的垂直位置。這有效地定位在對象的佈局後
一、對控件使用setTranslationY(i),意味着在豎直方向上將該控件從它本來的位置偏移i個像素,如果一個父控件中包含了一個子控件,對父控件調用了該方法,那麼父控件的TranslationY = i,而子控件的TranslationY = 0;

發佈了38 篇原創文章 · 獲贊 45 · 訪問量 13萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章