Dave..
10
您可以使用包含TextView和ImageView的RelativeLayout创建自己的按钮.
android:layout_width="wrap_content"
android:layout_height="wrap_content"
onClick="[yourLoginMethod]" >
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="Log In" />
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/login_text"
android:visibility="gone" />
然后,无论您调用哪种登录方法,都要更改TextView的内容,使其右对齐,并将ImageView可见性设置为可见.
loginText.setText("Logging In...");
LayoutParams params = loginText.getLayoutParams();
params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
loginText.setLayoutParams(params);
loginLoading.setVisibility(View.VISIBLE);
然后我还会有一些代码可以在登录失败时撤消这些更改.