private void bindButterKnife() { ButterKnife.bind(this); }
某人帮助我了private void setUserRecyclerView() { mUsersChatAdapter = new UsersChatAdapter(this, new ArrayList<User>()); mUsersRecyclerView.setLayoutManager(new LinearLayoutManager(this)); mUsersRecyclerView.setHasFixedSize(true); mUsersRecyclerView.setAdapter(mUsersChatAdapter); }
答案 0 :(得分:1)
<a title='Project 1'class="text1" onclick="showDiv('welcomeDiv1')">Project 1</a>
<a title='Project 2' class="text1" onclick="showDiv('welcomeDiv2')">Project 2</a>
<div class="websites">
<div id="welcomeDiv1" style="display:none;" class="answer_list" >1</div>
<div id="welcomeDiv2" style="display:none;" class="answer_list" >2</div>
</div>
<script>
function showDiv(div_id) {
var divsToHide = document.getElementsByClassName("answer_list"); //divsToHide is an array
for(var i = 0; i < divsToHide.length; i++){
divsToHide[i].style.display = "none"; // hide your divisions
}
document.getElementById(div_id).style.display = "block"; //show your division
}
</script>
并将ButterKnife用作onViewCreated
使用ButterKnife.bind(this, view)
代替getActivity()
this