草庐IT

mat-button

全部标签

android - Button 的 "state_focused"状态是什么?

我希望按钮背景在单击按钮后保持某种颜色,并在按下其他按钮时再次更改颜色。我认为这是“state_focused”状态。但我的按钮似乎只有两种状态是按下或未按下。我是否正确理解state_focused状态,还是我的StateListDrawable(见下文)错误? 最佳答案 state_focused是当按钮使用dpad或轨迹球聚焦时。使用触摸时,View通常不会显示焦点状态。 关于android-Button的"state_focused"状态是什么?,我们在StackOverflow

android - setImeOptions : why the "Done" button does not show on the soft keyboard?

我尝试使用input.setImeOptions(EditorInfo.IME_ACTION_DONE)设置软键盘上的“完成”按钮;但“完成”按钮根本不显示在软键盘上。有什么建议吗?publicvoidmodif(intposition){AlertDialog.Builderalert=newAlertDialog.Builder(MainActivity.this);alert.setTitle("Modifica");EditTextinput=newEditText(MainActivity.this);input.setImeOptions(EditorInfo.IME_AC

android - setImeOptions : why the "Done" button does not show on the soft keyboard?

我尝试使用input.setImeOptions(EditorInfo.IME_ACTION_DONE)设置软键盘上的“完成”按钮;但“完成”按钮根本不显示在软键盘上。有什么建议吗?publicvoidmodif(intposition){AlertDialog.Builderalert=newAlertDialog.Builder(MainActivity.this);alert.setTitle("Modifica");EditTextinput=newEditText(MainActivity.this);input.setImeOptions(EditorInfo.IME_AC

Android EditText 和 Button 在同一行

我需要在Search按钮旁边有一个Edittext。EditText应该尽可能多地填充宽度,按钮应该在右边并且足够大以容纳它的文本。现在看起来像这样:[EDITTEXT][Search]但应该是这样的:[.......EDITTEXT.......][Search]这是XML: 最佳答案 一定要相对布局吗?我建议如下:将EditTextlayout_width设置为fill_parent并将其layout_weight设置为1,如下所示: 关于AndroidEditText和Button

Android EditText 和 Button 在同一行

我需要在Search按钮旁边有一个Edittext。EditText应该尽可能多地填充宽度,按钮应该在右边并且足够大以容纳它的文本。现在看起来像这样:[EDITTEXT][Search]但应该是这样的:[.......EDITTEXT.......][Search]这是XML: 最佳答案 一定要相对布局吗?我建议如下:将EditTextlayout_width设置为fill_parent并将其layout_weight设置为1,如下所示: 关于AndroidEditText和Button

android - 以编程方式更改android中Button的宽度

如何以编程方式更改Button的width。我可以更改height但宽度不会改变。以下是我的代码fragmentprivatevoidcreateButton(finalStringlabel){Buttonbutton=newButton(this);button.setText(label);button.setWidth(10);button.setHeight(100);button.setOnClickListener(newOnClickListener(){@OverridepublicvoidonClick(Viewv){}});mMenuContainer.addVi

android - 以编程方式更改android中Button的宽度

如何以编程方式更改Button的width。我可以更改height但宽度不会改变。以下是我的代码fragmentprivatevoidcreateButton(finalStringlabel){Buttonbutton=newButton(this);button.setText(label);button.setWidth(10);button.setHeight(100);button.setOnClickListener(newOnClickListener(){@OverridepublicvoidonClick(Viewv){}});mMenuContainer.addVi

android - MAT (Eclipse Memory Analyzer) - 如何从内存转储中查看位图

我正在EclipseMemoryAnalyzer的帮助下分析我的Android应用程序的内存使用情况。(也称为MAT)。有时我可以找到android.graphics.Bitmap类的奇怪实例,利用大部分堆。问题是我找不到这个位图的来源,没有filename,没有resourceID,什么都没有。我可以为位图找到的所有信息如下:我假设有一个带有图像像素数组的字段mBuffer。但它是某种内部Android格式,而不是PNG。问题:如何从内存转储中查看此位图表示的图像? 最佳答案 我找到了一种查看此类位图的方法:首先需要下载安装GIM

android - MAT (Eclipse Memory Analyzer) - 如何从内存转储中查看位图

我正在EclipseMemoryAnalyzer的帮助下分析我的Android应用程序的内存使用情况。(也称为MAT)。有时我可以找到android.graphics.Bitmap类的奇怪实例,利用大部分堆。问题是我找不到这个位图的来源,没有filename,没有resourceID,什么都没有。我可以为位图找到的所有信息如下:我假设有一个带有图像像素数组的字段mBuffer。但它是某种内部Android格式,而不是PNG。问题:如何从内存转储中查看此位图表示的图像? 最佳答案 我找到了一种查看此类位图的方法:首先需要下载安装GIM

c++ - 检查 cv::Point 是否在 cv::Mat 内

有谁知道Opencv是否提供了一个函数来检查cv::Point是否在cv::Mat内?基本上我在做:intx=(current.x-offset);inty=current.y;if(x>=0&&y>=0&&x(y,x)==0)){returncv::Point(x,y);}}我想知道是否有更快的方法?或者如果这样做不好? 最佳答案 你可以构造一个大小为cv::Mat的cv::Rect并使用它的contains()方法:cv::Rectrect(cv::Point(),mat.size());cv::Pointp(x,y);if(r