我正在尝试使我的 TextView layout_width 填充父级抛出代码。这是我的代码:
TextView WatchMovieTitle;
private void PrintTheMovieAndYear() {
if (CountWords() > 23) {
// this is what im doing wrong
// WatchMovieTitle.setLayoutParams
// (new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
WatchMovieTitle.setText(movieList.get("movieName") + " " + "("
+ movieList.get("movieYear") + ")");
WatchMovieYear.setVisibility(View.GONE);
} else {
WatchMovieYear
.setText(" " + "(" + movieList.get("movieYear") + ")");
}
}
谢谢!