小编fis*_*h40的帖子

使linearlayout可滚动

<?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布局可滚动.你可以给我这样做的建议吗?

android

1
推荐指数
1
解决办法
5325
查看次数

如何将复选框放在屏幕的右侧

<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的右侧.

xml android android-emulator

0
推荐指数
1
解决办法
4616
查看次数

显示来自Ruby表的数据

我是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结果.那么我应该在这里写什么来从数组中获取数据?谢谢

ruby ruby-on-rails ruby-on-rails-3 ruby-on-rails-3.1

0
推荐指数
1
解决办法
182
查看次数

Android时间问题

 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)

java android

0
推荐指数
1
解决办法
80
查看次数

使用搜索栏移动图像

滚动搜索栏时如何移动图像?我想在更改搜索栏拇指位置时移动此指示器图像.

这是图像.

在此输入图像描述

android android-layout

0
推荐指数
1
解决办法
4411
查看次数