我尝试过以下代码,它对Activity类运行良好,但我需要扩展ListActivity类,但是这段代码给出了异常。 该类扩展了ListActivity
setContentView(R.layout.main);
textView = (TextView) findViewById(this .getResources()
.getIdentifier("statusText", "id",
"com.customcoverflowproject.customcoverflowapplication"));
// note resources below are taken using getIdentifier to allow importing
// this library as library.
final CoverFlow coverFlow1 = (CoverFlow) findViewById(this
.getResources().getIdentifier("coverflow", "id",
"com.customcoverflowproject.customcoverflowapplication"));
setupCoverFlow(coverFlow1, false);
"CoverFlow is another class which inherit to Gallery".
答案 0 :(得分:0)
以下是答案:
final CoverFlow coverFlow1 = new CoverFlow(this);
relativeWWParam=new RelativeLayout.LayoutParams(new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT));
relativeFWParam=new RelativeLayout.LayoutParams(new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.FILL_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT));
relativeFFParam=new RelativeLayout.LayoutParams(new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.FILL_PARENT, RelativeLayout.LayoutParams.FILL_PARENT));
relativeWWParam.setMargins(-((width/2)+(width/10)), 0, 0, 0);
getListView().setLayoutParams(relativeWWParam);