samsung s2 screen rotation problem

samsung s2 screen rotation problem it is not working in the proper way i have changed lcd speaker strip then also it is same please help me