本文整理匯總了Java中android.widget.LinearLayout.removeViewAt方法的典型用法代碼示例。如果您正苦於以下問題:Java LinearLayout.removeViewAt方法的具體用法?Java LinearLayout.removeViewAt怎麽用?Java LinearLayout.removeViewAt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.LinearLayout
的用法示例。
在下文中一共展示了LinearLayout.removeViewAt方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: recycleItems
import android.widget.LinearLayout; //導入方法依賴的package包/類
/**
* Recycles items from specified layout.
* There are saved only items not included to specified range.
* All the cached items are removed from original layout.
*
* @param layout the layout containing items to be cached
* @param firstItem the number of first item in layout
* @param range the range of current wheel items
* @return the new value of first item number
*/
public int recycleItems(LinearLayout layout, int firstItem, ItemsRange range) {
int index = firstItem;
for (int i = 0; i < layout.getChildCount();) {
if (!range.contains(index)) {
recycleView(layout.getChildAt(i), index);
layout.removeViewAt(i);
if (i == 0) { // first item
firstItem++;
}
} else {
i++; // go to next item
}
index++;
}
return firstItem;
}
示例2: recycleItems
import android.widget.LinearLayout; //導入方法依賴的package包/類
/**
* Recycles items from specified layout. There are saved only items not
* included to specified range. All the cached items are removed from
* original layout.
*
* @param layout
* the layout containing items to be cached
* @param firstItem
* the number of first item in layout
* @param range
* the range of current wheel items
* @return the new value of first item number
*/
public int recycleItems(LinearLayout layout, int firstItem, ItemsRange range) {
int index = firstItem;
for (int i = 0; i < layout.getChildCount();) {
if (!range.contains(index)) {
recycleView(layout.getChildAt(i), index);
layout.removeViewAt(i);
if (i == 0) { // first item
firstItem++;
}
} else {
i++; // go to next item
}
index++;
}
return firstItem;
}
示例3: recycleItems
import android.widget.LinearLayout; //導入方法依賴的package包/類
/**
* Recycles items from specified layout.
* There are saved only items not included to specified range.
* All the cached items are removed from original layout.
*
* @param layout the layout containing items to be cached
* @param firstItem the number of first item in layout
* @param range the range of current wheel items
* @return the new value of first item number
*/
public int recycleItems(LinearLayout layout, int firstItem, ItemsRange range) {
int index = firstItem;
for (int i = 0; i < layout.getChildCount();) {
if (!range.contains(index)) {
recycleView(layout.getChildAt(i), index);
layout.removeViewAt(i);
if (i == 0) { // first item
firstItem++;
}
} else {
i++;
}
index++;
}
return firstItem;
}
示例4: recycleItems
import android.widget.LinearLayout; //導入方法依賴的package包/類
/**
* Recycles items from specified layout.
* There are saved only items not included to specified range.
* All the cached items are removed from original layout.
*
* @param layout the layout containing items to be cached
* @param firstItem the number of first item in layout
* @param range the range of current wheel items
* @return the new value of first item number
*/
public int recycleItems(LinearLayout layout, int firstItem, ItemsRange range) {
int index = firstItem;
for (int i = 0; i < layout.getChildCount();) {
if (!range.contains(index)) {
recycleView(layout.getChildAt(i), index);
layout.removeViewAt(i);
if (i == 0) { // first item
firstItem++;
}
} else {
i++; // go to next item
}
index++;
}
return firstItem;
}
示例5: recycleItemRow
import android.widget.LinearLayout; //導入方法依賴的package包/類
private View recycleItemRow(View convertView, RowComputeResult rowInfo) {
LinearLayout ll = (LinearLayout) convertView;
int nbColumns = rowInfo.group.mDisplayCols;
if (hasCustomGroupView()) {
nbColumns = 1;
}
for (int i = 0; i < nbColumns; i++) {
View view = ll.getChildAt(i);
View newView = getItemView(rowInfo, i, view, ll);
if (view != newView) {
setupLayoutParams(newView);
ll.removeViewAt(i);
ll.addView(newView, i);
}
}
return ll;
}
示例6: recycleItems
import android.widget.LinearLayout; //導入方法依賴的package包/類
public int recycleItems(LinearLayout layout, int firstItem, ItemsRange range) {
int index = firstItem;
int i = 0;
while (i < layout.getChildCount()) {
if (range.contains(index)) {
i++;
} else {
recycleView(layout.getChildAt(i), index);
layout.removeViewAt(i);
if (i == 0) {
firstItem++;
}
}
index++;
}
return firstItem;
}
示例7: showErrorPage
import android.widget.LinearLayout; //導入方法依賴的package包/類
/**
* 顯示自定義錯誤提示頁麵,用一個View覆蓋在WebView
*/
protected void showErrorPage() {
LinearLayout webParentView = (LinearLayout) webView.getParent();
if (webParentView != null) {
initErrorPage();
while (webParentView.getChildCount() > 1) {
webParentView.removeViewAt(1);
}
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
webParentView.addView(mErrorView, 1, lp);
mIsErrorPage = true;
}
}
示例8: hideErrorPage
import android.widget.LinearLayout; //導入方法依賴的package包/類
protected void hideErrorPage() {
LinearLayout webParentView = (LinearLayout) mErrorView.getParent();
mIsErrorPage = false;
while (webParentView.getChildCount() > 1) {
webParentView.removeViewAt(1);
}
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
webParentView.addView(webView, 1, lp);
}