小编Ric*_*eng的帖子

如何在android中设置切换小部件的默认值

我用几个开关小部件编写我的xml文件.但我不知道如何将它们的默认值设置为ON.我只想在xml文件中解决这个问题所以没有Java.

xml android

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

是否有这样的方法调用"getBackgroundColor"?

在TextView中是否有这样的方法调用"getBackgroundColor"?如果我在一个LinearLayout中有2个textViews:tv1和tv2.我做了什么:tv1.setBackgroundColor(Color.BLUE)

现在,如果我想将tv2 的背景颜色设置为与tv1相同,我怎样才能首先获得 tv1中的backgroundColor,然后获取 tv2的setBackgroundColor?

android textview

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

为什么eclipse无法检测android设备?

Eclipse无法检测到我的Android设备,但它可以与模拟器一起运行.我对Android设备设置没有任何问题,因为它在我的旧笔记本电脑中运行良好.

任何的想法?

eclipse android

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

如何将TextView背景颜色更改为初始值

在我将TextView backgroundColor设置为我想要的任何内容之后.

Fri2030 =(TextView)findViewById(R.id.tvFri2030); Fri2030.setBackgroundColor(Color.BLUE);

如果我不想要任何颜色并初始化它,如何清理TextView backgroundColor.(不想用其他颜色覆盖)

thx的帮助!!

android textview

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

如何在列表视图中设置单个文本视图的文本颜色而不是所有每个文本视图?

我在自定义列表视图中获得了文本视图,我知道如何设置文本颜色,以便更改列表中的所有文本视图.但是现在,我只想要一个特定的视图来改变颜色,比如listview中有10个项目,我只想要改变第二个textview颜色,其余的保持不变.任何的想法?非常感谢所有的帮助〜

public class CheckWinNoAdapter extends ArrayAdapter<String> {
private final Context context;
private String[] values;



public CheckWinNoAdapter(Context context, String[] values) {
    // TODO Auto-generated constructor stub
    super(context, R.layout.list_draw, values);
    this.context = context;
    this.values = values;

}

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    LayoutInflater inflater = (LayoutInflater) context
        .getSystemService(Context.LAYOUT_INFLATER_SERVICE);

    View rowView = inflater.inflate(R.layout.list_draw, parent, false);
    TextView textView1 = (TextView) rowView.findViewById(R.id.chk_tv1);


    textView1.setText(values[position]);




}
Run Code Online (Sandbox Code Playgroud)

}

android listview

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

标签 统计

android ×5

textview ×2

eclipse ×1

listview ×1

xml ×1