首页 文章
  • 882 votes
     answers
     views

    片段中的findViewById

    我试图在片段中创建一个ImageView,它将引用我在片段的XML中创建的ImageView元素 . 但是, findViewById 方法仅在扩展Activity类时才有效 . 无论如何,我还可以在片段中使用它吗? public class TestClass extends Fragment { public View onCreateView(LayoutInflater infla...

热门问题