Download User Manual - Quinn

Transcript
Creating, Compiling and Running QCSPCChart Programs 317
We are going to change this to show a title string, and a couple of buttons, one to display a chart,
and the other to exit the program.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_gravity="top">
<TextView
android:text="@string/main_title"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="top"
android:layout_marginBottom="25dip"
android:textSize="24.5sp" />
<Button
android:id="@+id/menuitem1_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/menuitem1_label" />
<Button
android:id="@+id/exit_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/exit_label" />
</LinearLayout>
There are three string values which need to be resolved in the layout: main_title,
menuitem1_label, and exit_label. These are entered into the res/values/strings.xml table. First,
right click on the hello line and remove it, it won't be used. Then right click on the table and
select Add Key. Add a new key with a Row key name of main_title (keep all the keys lower
case). When it is added, double click on the rows Values field and enter in the program name,
SPC Application 1. Add a menuitem1_label key, with a value of X-Bar R Chart and an exit_label
key, with a value of Exit, the same way. You should end up with a table which looks like: