我想知道一些事情,我想用 Tabbed Activity 在 android 上创建一个应用程序,我已经完成了所有工作,但是我有一个问题,我想将 TextViews 放在其中一个选项卡中,如果我放了它,它不会让我实例化这
match = (TextView) findViewById (R.id.match);
程序告诉我:
Can not resolve method 'findViewById (int)'
我怎么能做到?有什么办法吗?
package com.example.jose.firebaseimportante;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.TextView;
public class TabbedUsuarioFutbol extends Fragment{
public TabbedUsuarioFutbol() {}
private TextView partido1;
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.futbol_tabbed_usuario, container, false);
return rootView;
match = (TextView)findViewById(R.id.match);
}
}