android.widget.ListView.setId()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(156)

本文整理了Java中android.widget.ListView.setId()方法的一些代码示例,展示了ListView.setId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ListView.setId()方法的具体详情如下:
包路径:android.widget.ListView
类名称:ListView
方法名:setId

ListView.setId介绍

暂无

代码示例

代码示例来源:origin: arcadefire/nice-spinner

listView.setId(getId());
listView.setDivider(null);
listView.setItemsCanFocus(true);

代码示例来源:origin: tianshaojie/AndroidFine

@Override
protected ListView createRefreshableView(Context context, AttributeSet attrs) {
  ListView lv = createListView(context, attrs);
  // Set it to this so it can be used in ListActivity/ListFragment
  lv.setId(android.R.id.list);
  return lv;
}

代码示例来源:origin: tianshaojie/AndroidFine

/**
 * 创建listView 如果要兼容API9,需要修改此处
 *
 * @param context 上下文
 * @param attrs   AttributeSet
 * @return ListView
 */
@Override
protected ListView createRootView(Context context, AttributeSet attrs) {
  ListView lv = new ListView(context, attrs);
  // Set it to this so it can be used in ListActivity/ListFragment
  lv.setId(android.R.id.list);
  return lv;
}

代码示例来源:origin: vekexasia/android-edittext-validator

@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  ListView mLv = new ListView(this);
  mLv.setId(android.R.id.list);
  setContentView(mLv); // Don't try this at home :)
  setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, stringItems));
  getListView().setOnItemClickListener(this);
}

代码示例来源:origin: stackoverflow.com

listView.setId(android.R.id.list);
listView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT, 1));
layout.addView(listView);

代码示例来源:origin: ISchwarz23/SortableTableView

private void setupTableDataView(final AttributeSet attributes, final int styleAttributes) {
  final LayoutParams dataViewLayoutParams = new LayoutParams(getWidthAttribute(attributes), LayoutParams.MATCH_PARENT);
  if (isInEditMode()) {
    tableDataAdapter = new EditModeTableDataAdapter(getContext());
  } else {
    tableDataAdapter = new DefaultTableDataAdapter(getContext());
  }
  tableDataAdapter.setRowBackgroundProvider(dataRowBackgroundProvider);
  tableDataView = new ListView(getContext(), attributes, styleAttributes);
  tableDataView.setOnItemClickListener(new InternalDataClickListener());
  tableDataView.setOnItemLongClickListener(new InternalDataLongClickListener());
  tableDataView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
  tableDataView.setAdapter(tableDataAdapter);
  tableDataView.setId(R.id.table_data_view);
  tableDataView.setOnScrollListener(new InternalOnScrollListener());
  swipeRefreshLayout = new SwipeRefreshLayout(getContext());
  swipeRefreshLayout.setLayoutParams(dataViewLayoutParams);
  swipeRefreshLayout.addView(tableDataView);
  swipeRefreshLayout.setColorSchemeColors(headerColor);
  swipeRefreshLayout.setEnabled(false);
  addView(swipeRefreshLayout);
}

代码示例来源:origin: shanyao0/SimpleApp

@Override
protected ListView createRefreshableView(Context context, AttributeSet attrs) {
  ListView lv = createListView(context, attrs);
  // Set it to this so it can be used in ListActivity/ListFragment
  lv.setId(android.R.id.list);
  return lv;
}

代码示例来源:origin: myxh/CoolShopping

@Override
protected ListView createRefreshableView(Context context, AttributeSet attrs) {
  ListView lv = createListView(context, attrs);
  // Set it to this so it can be used in ListActivity/ListFragment
  lv.setId(android.R.id.list);
  return lv;
}

代码示例来源:origin: kaku2015/WeatherAlarmClock

@Override
protected ListView createRefreshableView(Context context, AttributeSet attrs) {
  ListView lv = createListView(context, attrs);
  // Set it to this so it can be used in ListActivity/ListFragment
  lv.setId(android.R.id.list);
  return lv;
}

代码示例来源:origin: open-android/PullToRefresh

@Override
protected ListView createRefreshableView(Context context, AttributeSet attrs) {
  ListView lv = createListView(context, attrs);
  // Set it to this so it can be used in ListActivity/ListFragment
  lv.setId(android.R.id.list);
  return lv;
}

代码示例来源:origin: huangfangyi/FanXin

@Override
protected ListView createRefreshableView(Context context, AttributeSet attrs) {
  ListView lv = createListView(context, attrs);
  // Set it to this so it can be used in ListActivity/ListFragment
  lv.setId(android.R.id.list);
  return lv;
}

代码示例来源:origin: Wan7451/Wan_RecycleViewAdapter

@Override
protected ListView createRefreshableView(Context context, AttributeSet attrs) {
  ListView lv = createListView(context, attrs);
  // Set it to this so it can be used in ListActivity/ListFragment
  lv.setId(android.R.id.list);
  return lv;
}

代码示例来源:origin: AndroidHensen/YaNi

@Override
protected ListView createRefreshableView(Context context, AttributeSet attrs) {
  ListView lv = createListView(context, attrs);
  // Set it to this so it can be used in ListActivity/ListFragment
  lv.setId(android.R.id.list);
  return lv;
}

代码示例来源:origin: Uphie/ONE-Unofficial

@Override
protected ListView createRefreshableView(Context context, AttributeSet attrs) {
  ListView lv = createListView(context, attrs);
  // Set it to this so it can be used in ListActivity/ListFragment
  lv.setId(android.R.id.list);
  return lv;
}

代码示例来源:origin: gdpancheng/LoonAndroid3

@Override
protected ListView createRefreshableView(Context context, AttributeSet attrs) {
  ListView lv = createListView(context, attrs);
  // Set it to this so it can be used in ListActivity/ListFragment
  lv.setId(android.R.id.list);
  return lv;
}

代码示例来源:origin: alienjun/AJWaveRefreshForAndroid

@Override
protected ListView createRefreshableView(Context context, AttributeSet attrs) {
  ListView lv = createListView(context, attrs);
  // Set it to this so it can be used in ListActivity/ListFragment
  lv.setId(android.R.id.list);
  return lv;
}

代码示例来源:origin: lb377463323/GraphicsTestBed

private void initPicturePopupWindow() {
  mPictureAdapter = new MyAdapter(mPictureSizeList);
  mPictureListView = new ListView(this);
  mPictureListView.setId(R.id.pictureId);
  mPictureListView.setAdapter(mPictureAdapter);
  if (mPicturePopupWindow == null) {
    mPicturePopupWindow = new PopupWindow(mPictureListView, 320, 320,true);
  }
  mPictureListView.setOnItemClickListener(this);
}

代码示例来源:origin: jjhesk/KickAssSlidingMenu

@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  mHelper = new SlidingActivityHelper(this);
  mHelper.onCreate(savedInstanceState);
  ListView listView = new ListView(this);
  listView.setId(android.R.id.list);
  setContentView(listView);
}

代码示例来源:origin: TuGengs/Drosophila_Distinguish

@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  mHelper = new SlidingActivityHelper(this);
  mHelper.onCreate(savedInstanceState);
  ListView listView = new ListView(this);
  listView.setId(android.R.id.list);
  setContentView(listView);
}

代码示例来源:origin: MinTate/Mleaf

@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  mHelper = new SlidingActivityHelper(this);
  mHelper.onCreate(savedInstanceState);
  ListView listView = new ListView(this);
  listView.setId(android.R.id.list);
  setContentView(listView);
}

相关文章

ListView类方法