如何删除文本输入md下面的默认行.
我已经在下面尝试了所有这些,但"默认"样式仍然保持这一行.
$text-input-md-highlight-color: "transparent";
$text-input-md-highlight-color-invalid : "transparent";
$text-input-md-highlight-color-valid : "transparent";
$text-input-md-background-color : "transparent";
$text-input-md-show-focus-highlight : "transparent";
$text-input-md-show-invalid-highlight: "transparent";
$text-input-md-show-valid-highlight : "transparent";
$text-input-md-show-success-highlight: false;
$text-input-md-show-error-highlight: false;
// Input highlight - normal
$text-input-md-highlight-color: "transparent";
// Input highlight - valid
$text-input-md-hightlight-color-valid: "transparent";
// Input highlight - invalid
$text-input-md-hightlight-color-invalid: "transparent";
Run Code Online (Sandbox Code Playgroud) 我按照此处描述的每个步骤操作:https://material.angular.io/guide/getting-started
我得到的错误
ERROR in ./src/app/app.module.ts
Module not found: Error: Can't resolve '@angular/material' in '/Users/isabelle/my-project/src/app'
@ ./src/app/app.module.ts 14:0-51
@ ./src/main.ts
@ multi webpack-dev-server/client?http://localhost:4200/ ./src/main.ts
Run Code Online (Sandbox Code Playgroud)
我做了什么
npm install -g @angular/cli
ng new my-project
npm install --save @angular/material
Run Code Online (Sandbox Code Playgroud)
在src/app/app.module.ts中
import { MaterialModule } from '@angular/material';
// other imports
@NgModule({
imports: [MaterialModule],
...
})
export class PizzaPartyAppModule { }
Run Code Online (Sandbox Code Playgroud) 我正在尝试RecyclerView从Realm数据库填充中删除一个项目,我收到以下错误:
java.lang.IllegalStateException: Illegal State:
Object is no longer valid to operate on. Was it deleted by another thread?
Run Code Online (Sandbox Code Playgroud)
假设 我猜我正在尝试访问它已被删除,但我不明白在哪里.
上下文: 我正在显示城市列表,并且long在项目上单击会显示一个要求确认删除的对话框.
该项目在数据库中被删除,因为当我重新启动应用程序时,它已不存在了.
领域到ArrayList
public static ArrayList<City> getStoredCities(){
RealmQuery<City> query = getRealmInstance().where(City.class);
final RealmResults<City>results =
realm.where(City.class)
.findAllSorted("timestamp", Sort.DESCENDING);
results.size();
ArrayList<City> cityArrayList = new ArrayList<>();
for(int i = 0; i< results.size(); i++){
cityArrayList.add(results.get(i));
}
return cityArrayList;
}
Run Code Online (Sandbox Code Playgroud)
对话框代码
builder.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
RealmHelper.removeCity(cityArrayList.get(position));
cityArrayList.remove(position);
mRecyclerView.removeViewAt(position);
mCityListAdapter.notifyItemRemoved(position);
mCityListAdapter.notifyItemRangeChanged(position, cityArrayList.size());
mCityListAdapter.notifyDataSetChanged(); …Run Code Online (Sandbox Code Playgroud) 有没有办法在使用多台显示器时拆分 Xcode 界面?我有 2 台显示器,但仍然没有找到一种在 1 台以上显示器上使用它的简单方法(左侧的故事板,右侧的代码) - 就像在 Android 中使用 Intellij 时可以做的一样 - 简单的拖放窗口
感谢您的任何提示,
问题:当在recyclelerview中的项目上长按时,无法显示显示"删除"选项的上下文菜单
预期结果:见下图
我几乎就在那里,但我遗漏了一些东西,使contextMenu显示在longClick上.
这是我放在viewHolder中的内容.我不知道我应该添加什么以及在onLongClick事件中显示上下文菜单的位置.
我跳过了一些代码行,并保留了与我的问题相关的代码.
感谢你的帮助,
我的界面处理两种类型的点击
public interface OnItemClickListener{
void onItemClick(int position);
}
public interface OnItemLongClickListener{
void onItemLongClick(int position);
}
Run Code Online (Sandbox Code Playgroud)
查看者代码
public void bindLongClick(final int position, final OnItemLongClickListener onItemLongClickListener) {
itemView.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
onItemLongClickListener.onItemLongClick(position);
return true;
}
});
}
@Override
public void onCreateContextMenu(ContextMenu contextMenu, View view, ContextMenu.ContextMenuInfo contextMenuInfo){
//menuInfo is null
Log.v(LOG_TAG, "grrr");
contextMenu.setHeaderTitle("Select The Action");
contextMenu.add(0, view.getId(), 0, "Supprimer");//groupId, itemId, order, title
}
Run Code Online (Sandbox Code Playgroud)
适配器代码
@Override
public void onBindViewHolder(CityListViewholder holder, int …Run Code Online (Sandbox Code Playgroud) 我正在尝试将选项列表动态加载到选择输入中.我得到的错误如下:
Error in ./PhonePage class PhonePage - caused by: Failed to execute 'setAttribute' on 'Element': '[[ngModel]]' is not a valid attribute name.
Run Code Online (Sandbox Code Playgroud)
这是我的phone.ts代码
@Component({
selector: 'page-phone',
templateUrl: 'phone.html'
})
export class PhonePage {
selectedValue: number;
optionList: Array<{value:number, text: string}> = [];
constructor(public navCtrl: NavController, public navParams: NavParams) {
this.navCtrl = navCtrl
this.initOptionList();
}
moveToEmail(){
this.navCtrl.push(EmailPage)
}
initOptionList(){
this.optionList.push({value: 1,text:"FR +33"});
this.optionList.push({value: 1,text:"BE +32"});
this.optionList.push({value: 1,text:"LU +352"});
this.optionList.push({value: 1,text:"CH +41"});
this.optionList.push({value: 1,text:"GB +44"});
this.optionList.push({value: 1,text:"IE +353"});
this.optionList.push({value: 1,text:"NL +31"});
this.optionList.push({value: 1,text:"ES …Run Code Online (Sandbox Code Playgroud) 我在网上搜索找到在Ionic2中实现url路由的解决方案,我似乎找不到使用URL访问页面的方法.
我需要能够在Web应用程序中获取页面的物理URL; 为了能够在Web应用程序之外共享它.
谢谢,
我对不应该抛出的异常感到困惑。\n错误如下:
\n\njava.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.String\nRun Code Online (Sandbox Code Playgroud)\n\n但是,我的代码不会尝试将布尔值转换为字符串 \xc3\x94_o\n编译器在指示异常来自何处时可能是错误的吗?我用的是华为
\n\n这部分触发异常:
\n\nif(SharedPreferencesManager.getUserMRZ(ScanEUID.this).equals("0")\n&& SharedPreferencesManager.getUserDocumentIdFront(ScanEUID.this) != null \n&& SharedPreferencesManager.getUserDocumentIdBack(ScanEUID.this) != null)\n{\nRun Code Online (Sandbox Code Playgroud)\n\n相关方法如下
\n\npublic static String getUserMRZ(Context context){\n return getSharedPreferences(context).getString(Constants.USER_HAS_MRZ, "0");\n}\npublic static String getUserDocumentIdFront(Context context) {\n return getSharedPreferences(context).getString(Constants.USER_DOCUMENT_ID_FRONT, null);\n}\npublic static String getUserDocumentIdBack(Context context) {\n return getSharedPreferences(context).getString(Constants.USER_DOCUMENT_ID_BACK, null);\n}\nRun Code Online (Sandbox Code Playgroud)\n\nsetMRZ 方法
\n\npublic static void setUserMRZ(Context context, String has_mrz){\n final SharedPreferences.Editor editor = getSharedPreferences(context).edit();\n editor.putString(Constants.USER_HAS_MRZ, has_mrz);\n editor.apply();\n}\nRun Code Online (Sandbox Code Playgroud)\n 我试图将数据从Objective-C ViewController传递到Swift ViewController,并且在我的Objective-C控制器中遇到此错误:
在“ UIViewController”类型的对象上找不到属性“ type”
我的Objective-C代码:
UIViewController *mainController = [self.storyboard instantiateViewControllerWithIdentifier:@"IdentitySelfieViewController"];
mainController.type = "passport";
[self.navigationController pushViewController:mainController animated:YES];
Run Code Online (Sandbox Code Playgroud)
导入到桥接头文件中:
#import "PassportViewController.h"
Run Code Online (Sandbox Code Playgroud)
并在我的Swift View Controller中创建了相应的String
let type = ""
Run Code Online (Sandbox Code Playgroud)
感谢您的任何帮助
我正在迁移到Firebase新版本,并且在尝试从快照获取值时出现以下错误
com.google.firebase.database.DatabaseException: Can't convert object of type java.lang.Long to type java.util.Date
Run Code Online (Sandbox Code Playgroud)
尝试通过以下方法从快照获取值时会发生这种情况
public void getUpdates(DataSnapshot dataSnapshot){
Item item = dataSnapshot.getValue(Item.class);
itemArrayList.add(item);
itemAdapter.refreshItem(itemArrayList);
}
Run Code Online (Sandbox Code Playgroud)
我想它与Item对象有关,但它之前有用,所以我无法弄清楚出了什么问题.我确实在使用日期.
Firebase项目结构
物品对象
private String title;
private String description;
private HashMap<String, ItemPicture> picturesHashMap;
private Date publishedDate;
private Date deletionDate;
private String condition;
private String delivery;
private String uid;
private int reported;
private boolean given;
private Location location;
private String frontImage;
private String uniqueID;
Run Code Online (Sandbox Code Playgroud)
任何帮助将受到高度赞赏.
今天我转向Realm,我想知道RealmConfiguration的确切目的.
让我们假设我有两个使用Realm的活动.
获取Realm的defaultInstance时,我必须指定RealmConfiguration.我每次参加两项活动都需要打电话吗?它究竟做了什么?这是我的数据吗?我应该在应用程序类中声明一次吗?
// Create a RealmConfiguration that saves the Realm file in the app's "files" directory.
RealmConfiguration realmConfig = new RealmConfiguration.Builder(this).build();
Realm.setDefaultConfiguration(realmConfig);
Run Code Online (Sandbox Code Playgroud)
我试图搜索Realm,但找不到答案.
感谢你的帮助,
我试图将一个简单的字符串从Swift控制器传递给Objective-C控制器,但不幸的是它不起作用.
我得到的错误:
'EUIDViewController'类型的值没有成员'stringPassed'
Swift Code发送字符串
let pvc = EUIDViewController(nibName: "ScannerViewController", bundle: nil)
if isHasCameraPermission {
pvc.stringPassed = "test"
present(pvc, animated: true, completion: { _ in })
}
Run Code Online (Sandbox Code Playgroud)
Objective-C代码接收字符串
@property (strong, nonatomic) NSString* stringPassed;
- (void)viewDidLoad {
[super viewDidLoad];
[self initOCR];
NSLog(@"String: %@", self.stringPassed);
}
Run Code Online (Sandbox Code Playgroud)
更新:我将#import"EUIDViewController.h"添加到了bridging-header中