如何将名为 Reload 的按钮对齐到我的操作栏的右侧?我知道这是可能的
activity_main_ab.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="fill_horizontal"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:orientation="horizontal" >
<Button
android:id="@+id/action_bar_button_about"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/ios_btn"
android:textColor="#ffffff"
android:text="about" />
<Button
android:id="@+id/action_bar_button_reload"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:background="@drawable/ios_btn"
android:layout_weight="1"
android:textColor="#ffffff"
android:text="reload" />
</LinearLayout>
</RelativeLayout>
这是我的MainActivity.java
package jb.cydia;
import android.os.Bundle;
import android.app.ActionBar;
import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final ActionBar ab = getActionBar();
ab.setDisplayShowHomeEnabled(false);
ab.setDisplayShowTitleEnabled(false);
final LayoutInflater inflater = (LayoutInflater)getSystemService("layout_inflater");
View view = inflater.inflate(R.layout.activity_main_ab,null);
ab.setCustomView(view);
ab.setDisplayShowCustomEnabled(true);
}
}
是的,看起来 IOS 我知道关于定制的机器人,对吧?