<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/bag"
android:layout_height="fill_parent" android:layout_width="fill_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/relativeLayout2"
style="@style/relbag"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
>
<TextView style="@style/CodeFont"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginTop="18dp"
android:textSize="15dp"
android:text="General Preference">
</TextView>
</LinearLayout>
<ListView
android:id="@+id/settingsListView1"
style="@style/listbag"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dip"
android:layout_marginRight="15dip"
android:layout_weight="100"
android:background="@drawable/radius"
android:listSelector="@drawable/list_selector"
android:paddingTop="8dip"
android:paddingBottom="8dip"
android:scrollbars="none"/>
<LinearLayout
android:id="@+id/relativeLayout2"
style="@style/relbag"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
>
<TextView style="@style/CodeFont"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginLeft="25dp"
android:textSize="15dp"
android:text="Notification Preference">
</TextView>
</LinearLayout>
<ListView style="@style/listbag" android:id="@+id/settingsListView2" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_weight="100"
android:layout_marginLeft="15dip" android:layout_marginRight="15dip"
android:layout_marginBottom="15dip"
android:background="@drawable/radius"
android:paddingLeft="5dip" android:paddingRight="5dip"
android:paddingTop="15dip" android:paddingBottom="15dip"
android:listSelector="@drawable/list_selector" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
我想让LinearLayout可滚动,但我不知道在这里有什么用,我试过ScrollView但它不起作用.我只想在LinearLayout中使用滚动而不是在listview中.我想让parnet布局可滚动.你可以给我这样做的建议吗?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dp"
android:orientation="horizontal">
<TextView
android:id="@+id/groups_massegesTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:layout_marginBottom="20dp"
android:layout_marginTop="20dp"
android:layout_marginLeft="10dp"
android:textColor="@color/list_text_color" />
<CheckBox
android:id="@+id/groups_massegescheckBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/checkbox_background"
android:button="@drawable/checkbox"
android:focusable="false"
android:layout_marginBottom="20dp"
android:layout_marginTop="20dp"
android:layout_marginRight="5dp"
android:layout_gravity="right"
/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
我正在使用linearlayout,我想在屏幕右侧设置复选框.我不想使用relativelayout.在linearlayout中有没有办法做到这一点.复选框始终位于textView的右侧.
我是Ruby的新手,我正在尝试从表中获取数据.所以看完这个
<%= puts @note.inspect %> I have this this result.
[#<Note id: 1, user_id: 1, note_type: 0, text: "Barev dzez", lat: 40.2290542420142, lng: 44.420879046875, deleted: false, created_at: "2012-04-26 14:10:05", updated_at: "2012-04-26 14:10:05">]
Run Code Online (Sandbox Code Playgroud)
所以当我调用Note.text(例如)时,我得到了nil结果.那么我应该在这里写什么来从数组中获取数据?谢谢
private void getSelectedTime(final String json){
Calendar now = Calendar.getInstance();
int year = now.get(Calendar.YEAR);
int month = now.get(Calendar.MONTH); // Note: zero based!
int day = now.get(Calendar.DAY_OF_MONTH);
int hour = now.get(Calendar.HOUR_OF_DAY);
int minute = now.get(Calendar.MINUTE);
int second = now.get(Calendar.SECOND);
int millis = now.get(Calendar.MILLISECOND);
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm");
JSONArray list;
JSONObject jsonObject;
try {
jsonObject = new JSONObject(json);
list = jsonObject.getJSONArray("3");
StringTokenizer tokenizer = new StringTokenizer(list.get(0).toString(),"-");
String startTime = tokenizer.nextToken();
String endTime = tokenizer.nextToken();
String temp1 = year+"/"+month+"/"+day+" "+startTime;
String temp2 …Run Code Online (Sandbox Code Playgroud)