国家代码的收集方式跟桌面一样:有SIM卡,取SIM卡国家代码; 无SIM,取手机系统语言中的国家代码部分。
android:layout_width="0dp" android:layout_width="fill_parent" 改成 android:layout_width="wrap_content" 就让android:layout_weight="1"无效
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="46dp">
<TextView
android:id="@+id/okbutton"
android:layout_width="0dp"
android:layout_height="45dp"
android:layout_weight="1"
android:background="@drawable/search_dialog_enter_background"
android:gravity="center"
android:text="@string/ok"
android:textColor="#ffffff"
android:textSize="16sp" />
<ImageView android:id="@+id/button_line2"
android:layout_width="1dp"
android:layout_height="fill_parent"
android:background="#a4a4a4" />
<TextView
android:id="@+id/canclebutton"
android:layout_width="0dp"
android:layout_height="45dp"
android:layout_weight="1"
android:background="@drawable/search_dialog_enter_background"
android:gravity="center"
android:text="@string/cancel"
android:textColor="#ffffff"
android:textSize="16sp" />
</LinearLayout>