我正在使用 Android 中 PageView 设置中的默认设置。我想保持非常简单。默认设置提供了一个 TextView 来放入文本,而我的文本会离开屏幕。是否可以垂直滚动?
// edited to make the code appear in the code block
public class DayFragment extends Fragment {
/**
* The fragment argument representing the section number for this
* fragment.
*/
public static final String ARG_SECTION_NUMBER = "section_number";
public DayFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Create a new TextView and set its text to the fragment's section
// number argument value.
TextView tView = new TextView(getActivity());
if(getArguments().getInt(ARG_SECTION_NUMBER) > 1){
tView.setText(getAllMeals(getArguments().getInt(
ARG_SECTION_NUMBER)-1));}
else {
getMeal();
tView.setText(message);
}
return tView;
}
}