嗨那裏我設法綁定我的XML文件到ViewPagerIndicator通過擴展它們作爲片段,但我不能使用必要的findViewById代碼引用我的按鈕代碼。這是我的代碼,因爲它是可以有人幫助「findViewById」不工作在ViewPagerIndicator片段
package com.example.sliding;
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.Button;
public class twoey extends Fragment {
Button lol;
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
View v = inflater.inflate(R.layout.two, null);
return v;
lol = (Button) findViewById (R.id.button1);
}
}
但是什麼都我嘗試做我不能得到findViewById字的小紅wriggly線可有人幫忙嗎?
我都試過,但然後我得到一個大紅色的波浪線的整條線路不解決問題 – Mizzeeboy 2013-04-11 06:55:01
廣場這條線以上的回報 – 2013-04-11 06:55:16
行不正確排序,看我的編輯! – madlymad 2013-04-11 06:58:37