我是Android编程的新手,如果之前有人问过这个问题,我很抱歉。 但是我无法在列表视图中添加页脚,其中包含来自服务的评论和评级数据。我只想要显示1个项目,之后应该显示更多的页脚。 我的代码是:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
</rule>
<rule name="WordPress Rule" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
但是这个页脚没有显示出来。这是我的logcat
// Footer to add
final TextView tvReadAll = new TextView(this);
tvReadAll.setTextSize(17f);
tvReadAll.setGravity(Gravity.CENTER_HORIZONTAL);
tvReadAll.setTextColor(R.drawable.list_selector);
tvReadAll.setText("Read All Reviews");
int limit =1;
for(int length=0;length<limit;length++) {
mLvReviews.getAdapter().getItem(1);
mLvReviews.addFooterView(tvReadAll);
}
tvReadAll.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Utility.setListViewHeightBasedOnChildren(mLvReviews);
tvReadAll.setVisibility(View.GONE);
}
});
adapter = new UserReviewsAdapter(ProDetailedInfo.this, array);
mLvReviews.setAdapter(adapter);