小编fis*_*h40的帖子

如何在Eclipse Indigo上安装SVN

我想安装svn存储库.Subclipse和Subversion之间有什么区别吗?

我到处搜索Subversion,但是我找不到关于Subversion的东西,我得到的只是Subclipse.你能给我一些指导怎么做吗?

eclipse svn eclipse-plugin

5
推荐指数
2
解决办法
3万
查看次数

如何将字符串添加到JsonArray中

我试图在JsonArray中添加字符串值,然后创建Json String以在服务器上发送它.

我在谷歌搜索,但我找不到任何有用的东西.谁能告诉我怎么做?谢谢

 JSONArray list = new JSONArray();
 list.put("Hello");
 list.put("Hey");
Run Code Online (Sandbox Code Playgroud)

之后我想创建JSONString

android json

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

java.lang.ClassCastException:android.graphics.drawable.LayerDrawable无法强制转换为android.graphics.drawable.GradientDrawable

在我的应用程序中,我正在尝试更改每个listView项目的背景颜色.为此,我使用的是图层列表中的形状.这是我的代码

drop_shadow.xml

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

    <item>
        <shape android:shape="rectangle">

            <gradient android:startColor="#B7B7B7"
                      android:endColor="#A1A1A1"
                      android:angle="270"/>
            <corners android:radius="10dp" />

        </shape>
    </item>

    <item android:top="1px">

        <shape android:shape="rectangle">

            <solid android:color="@color/color11"/>
            <corners android:radius="10dp" />
        </shape>

    </item>

</layer-list>
Run Code Online (Sandbox Code Playgroud)

main.xml中

<RelativeLayout 
                android:orientation="vertical"
                android:id="@+id/mainLayout"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@drawable/drop_shadow"/>
Run Code Online (Sandbox Code Playgroud)

当我调用这个方法时,我有ClassCastException

 private void setRoundedBackground(View view,int color){
        GradientDrawable gradientDrawable;
        gradientDrawable = (GradientDrawable) view.getBackground().mutate();
        gradientDrawable.setColor(getResources().getColor(color));
        gradientDrawable.invalidateSelf();

    }
Run Code Online (Sandbox Code Playgroud)

我如何从LayerDrawable获得GradientDrawable?

android android-layout

4
推荐指数
1
解决办法
2万
查看次数

如何创建未签名的apk

我正在使用InteliJ IDEA制作我的android项目.我想知道它是out/production文件夹中的unsigned apk吗?

另一种方法是我尝试从项目Structure/artifact ---> Android Application ---> from modul'MyModule'创建unsigned apk.然后我设置它应该位于的路径.在创建一个项目后,它创建了MyModule.apk,但是当我想在我的设备中安装这个apk文件时,它说"应用程序没有安装".

请有人告诉我在工件中应该做什么来获得结果.我假设资源没有在apk中完全添加.我在InteliJ Idea帮助中阅读了文档,但我无法获得积极的结果.

android intellij-idea apk

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

如何在不使用Scrollview的情况下使LinearLayout可滚动

<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" >

<RelativeLayout
        android:id="@+id/relativeLayout2"
            style="@style/relbag"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content">

        <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"
        android:id="@+id/genpref">
        </TextView>


    <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:background="@drawable/radius"
        android:listSelector="@drawable/list_selector"
        android:paddingTop="8dip"
        android:paddingBottom="8dip" 
        android:scrollbars="none"
        android:layout_below="@id/genpref"/>

        <TextView style="@style/CodeFont" 
        android:id="@+id/notpref"
        android:layout_height="wrap_content" 
        android:layout_width="wrap_content"
        android:layout_marginLeft="25dp"
        android:layout_marginTop="25dp"
        android:textSize="15dp"
        android:text="Notification Preference"
        android:layout_below="@id/settingsListView1">
        </TextView>


        <ListView style="@style/listbag" android:id="@+id/settingsListView2" android:layout_width="fill_parent"
         android:layout_height="fill_parent"
            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" 
            android:layout_below="@id/notpref" 
            android:scrollbars="none"
            />
            </RelativeLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

在我的应用程序中,我想在linearlayout中创建两个listview,并且不使用ScrollView使linearlayout可滚动.据我所知,scrollview在使用listview时遇到了问题.这张照片并不是我想要的,但让我们假装下面列表视图中有另一个列表视图.所以我想显示listview的所有可用项目(在我的app 2 listview的项目中)并使LinearLayout可滚动.ScrollView不能正常运行,因为它必须只有一个直接子项.我找不到解决方案.所以请帮我解决,谢谢

android

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

如何设置边框到布局

我想为Relativelayout设置一个边框.我使relativelayout可点击并使用选择器来更改所选颜色,我也使用形状来舍入布局的角落.但是,当我选择layou时,形状将包括所有背景,包括边框.我找不到解决这个问题的方法.

这是我的main.xml

<RelativeLayout android:id="@+id/map_refresh"
                android:layout_height="fill_parent" android:layout_width="wrap_content" 
                android:background="@drawable/settings_selector_up" 
                android:padding="15dp"
                android:layout_marginLeft="15dip" android:layout_marginRight="15dip" android:layout_marginTop="5dip">
                <TextView android:id="@+id/Text1" 
                    android:layout_height="wrap_content" android:layout_width="wrap_content"
                    android:text="Map refresh period">
                </TextView>
                <TextView android:id="@+id/TextView09" 
                    android:layout_height="wrap_content" android:layout_width="wrap_content"
                    android:text="1 min" 
                    android:layout_alignParentRight="true"
                    android:paddingRight="5dp">
                </TextView>
            </RelativeLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

这是我的settings_selector_up.xml

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <!-- Non focused states -->
    <item android:state_focused="false" android:state_selected="false"
        android:state_pressed="false" android:background="@drawable/settings_border_roundup" />
    <item android:state_focused="false" android:state_selected="true"
        android:state_pressed="false" android:drawable="@drawable/settings_border_roundup" />

    <!-- Focused states -->
    <item android:state_focused="true" android:state_selected="false"
        android:state_pressed="false" android:drawable="@drawable/settings_border_roundup" />
    <item android:state_focused="true" android:state_selected="true"
        android:state_pressed="false" android:drawable="@drawable/settings_border_roundup" />

    <!-- Pressed -->
    <item android:state_selected="true" android:state_pressed="true"
        android:drawable="@drawable/selector_pressed" > 
        </item>
    <item android:state_pressed="true" android:drawable="@drawable/list_selector_pressed" />
</selector> …
Run Code Online (Sandbox Code Playgroud)

android

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

未定义的方法`users_path'

<%= form_for @user1 do |f| %>

    Username: <%= f.text_field :username %>      <br />
    Password: <%= f.password_field :password %>  <br />.
    Email:    <%= f.email_field :email %> <br />

    <%= submit_tag "Add" %>

<% end %>
Run Code Online (Sandbox Code Playgroud)

我是ruby的新手,我正在尝试创建简单的程序,但我有这个错误,我找不到原因.我有这个错误

undefined method `users_path' for #<#<Class:0x000000020576f0>:0x0000000335d5d8>
Run Code Online (Sandbox Code Playgroud)

这里有什么解决方案?

class UserController < ApplicationController
  def add
    @user1 = User.new
    respond_to do |format|
      format.html
      format.json {render :json => @user1}
    end
  end
Run Code Online (Sandbox Code Playgroud)

ruby ruby-on-rails

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

在Android phonegap上获取SharedPreference值

在我的应用程序中,我将数据保存在SharedPreferences上。

这是我的代码

public void initUserData(Context context, String pKey1, String pKey2, long id) {
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext());

         prefs.edit().putString("key1", pKey1).commit();
         prefs.edit().putString("key2", pKey2).commit();
        prefs.edit().putLong("user.id", id).commit();
    }
Run Code Online (Sandbox Code Playgroud)

如何使用phonegap获取SharedPreferences值?我的意思是使用JavaScript获取数据

javascript android cordova

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

为什么所有颜色都一样?

我不明白为什么所有的颜色都会给出相同的结果.所有的textviews背景都是灰色的,虽然我有黑色,白色和红色.这里有什么问题?

<color name="color1">#FFFFFF</color>
    <color name="color2">#000000</color>
    <color name="color3">#FF0000</color? 


Map<Integer, Integer> map = new HashMap<Integer, Integer>();
        map.put(R.id.color1,R.color.color1);
        map.put(R.id.color2,R.color.color2);
        map.put(R.id.color3,R.color.color3);
        GradientDrawable gradientDrawable;
        TextView textView;
        for (Map.Entry<Integer,Integer> entry : map.entrySet()) {
            textView = findTextView(entry.getKey());
            gradientDrawable = (GradientDrawable) textView.getBackground().mutate();
            gradientDrawable.setColor(entry.getValue());
            gradientDrawable.invalidateSelf();
        }
Run Code Online (Sandbox Code Playgroud)

android android-layout

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

编码UTF-8不起作用

<html>
    <head>
        <title>????</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Run Code Online (Sandbox Code Playgroud)

我设置了元标记,但每当我打开浏览器(Chrome)时,我都必须转到工具 - >编码并在UTF-8上设置编码才能使其正常工作.有没有办法避免这一步,所以浏览器显示正确的UTF-8?

html php html5

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