我有这个SeekBar:
<SeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="26dp"
android:id="@+id/seekbar"
android:visibility="gone"
android:maxHeight="3dp"/>
Run Code Online (Sandbox Code Playgroud)
我试图使用maxHeight更改此SeekBar厚度.但没有改变.它看起来像这样:
所以我的问题是有可能以某种方式改变SeekBar厚度吗?如果有,怎么样?
我试过这个.无法在清单文件中找到configChanges.无论如何,如何禁用屏幕旋转(到横向模式)?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.joericharduz.akita"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.joericharduz.akita.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Run Code Online (Sandbox Code Playgroud) 我有查询,如果它们属于一个组,则连接字符串.
SELECT e.id,
ke.value,
re.value AS re_value,
GROUP_CONCAT(g.value,', ')
FROM entry e
INNER JOIN k_ele ke ON e.id = ke.fk
INNER JOIN r_ele re ON e.id = re.fk
INNER JOIN sense s ON e.id = s.fk
INNER JOIN gloss g ON s.id = g.fk
WHERE g.lang IS NULL
GROUP BY s.id
ORDER BY re_value
Run Code Online (Sandbox Code Playgroud)
但
GROUP_CONCAT(g.value,',')
给出了这个结果.
深情的关系,深情的关系,深情的关系,深情的关系,爱的关系,爱的关系,爱的关系,爱的关系
正如您所看到的,连接中存在重复.如何避免连接中的重复?
我检查了Preferences-> Editor-> Code completion.基本代码完成已打开.快捷方式是^空间.当我单击[控制] + [空格]时,它将打开聚光灯搜索而不是代码完成.如何解决这个问题呢?
我正在使用0.81.1版本的Realm.我有这门课:
public class KanjiComp extends RealmObject {
@PrimaryKey
private String character;
private String strokes;
private int frequency;
public String getCharacter() {
return character;
}
public void setCharacter(String character) {
this.character = character;
}
public String getStrokes() {
return strokes;
}
public void setStrokes(String strokes) {
this.strokes = strokes;
}
public int getFrequency() {
return frequency;
}
public void setFrequency(int frequency) {
this.frequency = frequency;
}
}
Run Code Online (Sandbox Code Playgroud)
我第一次创建这样的对象:
KanjiComp realmKanjiComp = realm.createObject(KanjiComp.class);
realmKanjiComp.setCharacter(cur.getString(cur.getColumnIndex("literal")));
realmKanjiComp.setStrokes(cur.getString(cur.getColumnIndex("strokes")));
realmKanjiComp.setFrequency(0);
Run Code Online (Sandbox Code Playgroud)
我想增加频率值.为此我需要帮助我更新频率的方法.
领域文档说明了这一点:
使用主键可以使用createOrUpdate()方法,该方法将查找具有此主键的现有对象,如果找到,则更新它; 如果没有找到,它将创建一个新对象.
但我找不到createOrUpdate()方法.使用JSON的所有方法.
我的完整代码如下所示: …
我在 NestedScrollView 中有 RecyclerView
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.NestedScrollView>
Run Code Online (Sandbox Code Playgroud)
我在大项目中遇到了这个问题,为了找到这个问题的解决方案,我创建了没有其他视图的新项目。
这是 MainActivity 的完整代码
class MainActivity : AppCompatActivity() {
var mItems = mutableListOf<String>()
var mAdapter = MyAdapter(mItems)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
recycler.layoutManager = LinearLayoutManager(this)
recycler.adapter = mAdapter
delayedLoadDataIfPossible(100)
recycler.viewTreeObserver.addOnScrollChangedListener {
delayedLoadDataIfPossible(100)
}
}
private fun delayedLoadDataIfPossible(delay: Long) {
Observable.timer(delay, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
.subscribe {
var scrollingReachedEnd = isScrollingReachedEnd()
if (scrollingReachedEnd) {
loadData()
}
}
}
private fun isScrollingReachedEnd(): Boolean {
val layoutManager = LinearLayoutManager::class.java.cast(recycler.layoutManager)
val …
Run Code Online (Sandbox Code Playgroud) 创建组织:
Organization organization = realm.createObject(Organization.class); // Create a new object
OrganizationId organizationId = realm.createObject(OrganizationId.class);
organizationId.setAggregateId("1");
organization.setOrganizationId(organizationId);
organization.setOrganizationName("1-? ??????? ??????????? ??????????? ????????");
organization.setAddress("?????: ?. ???????, ??. ??????, 2");
organization.setPhoneNumber("???.: (+99871) 214-51-01, 214-50-86, 214-50-43");
organization.setKey(organization.getOrganizationName().toLowerCase());
Run Code Online (Sandbox Code Playgroud)
当我在这个组织中添加新医生时,一切都会好起来的.应用程序工作没有任何错误:
Doctor doctor = realm.createObject(Doctor.class);
//FULL NAME
FullName fullName = realm.createObject(FullName.class);
fullName.setFirstName("Joe");
fullName.setLastName("Richard");
fullName.setMiddleName("Brown");
doctor.setFullName(fullName);
//CONTACTS
Contacts contacts = realm.createObject(Contacts.class);
RealmList<PhoneNumber> phoneNumberRealmList = new RealmList<>();
PhoneNumber pn = realm.createObject(PhoneNumber.class);
pn.setPhoneNumber("+998903735173");
phoneNumberRealmList.add(0, pn);
contacts.setPhoneNumbers(phoneNumberRealmList);
doctor.setContacts(contacts);
//ORGANIZATION
doctor.setOrganization(organization);
//SPECIALIZATION
RealmList<Specialization> specializationRealmList = new RealmList<>();
Specialization specialization = realm.createObject(Specialization.class);
specialization.setSpecializationName("??????????"); …
Run Code Online (Sandbox Code Playgroud) 我正在尝试了解 Android Activity 生命周期。为此,我创建了 Activity,其中覆盖了所有生命周期方法(onCreate、onStart、onRestart、onResume、onPause、onStop、onDestroy):
public class SecondActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);
Log.d("ActivityTutorial", "onCreate");
}
@Override
protected void onStart() {
super.onStart();
Log.d("ActivityTutorial", "onStart");
}
@Override
protected void onRestart() {
super.onRestart();
Log.d("ActivityTutorial", "onRestart");
}
@Override
protected void onResume() {
super.onResume();
Log.d("ActivityTutorial", "onResume");
}
@Override
protected void onPause() {
super.onPause();
Log.d("ActivityTutorial", "onPause");
}
@Override
protected void onStop() {
super.onStop();
Log.d("ActivityTutorial", "onStop");
}
@Override
protected void onDestroy() {
super.onDestroy();
Log.d("ActivityTutorial", "onDestroy");
}
}
Run Code Online (Sandbox Code Playgroud)
我在使用 Log.d(...) 进行日志记录的行上放置了断点。然后我尝试调试。onCreate …
我有几乎200k条目的表.当我尝试用LIKE搜索时,它非常慢.现在我决定使用FTS.所以我创建了两个索引来进行搜索.然后我创建了fts虚拟表.
`CREATE TABLE [search_eng] (
[id] INTEGER PRIMARY KEY AUTOINCREMENT,
[entry_id] INTEGER,
[re_value] TEXT,
[ke_value] TEXT,
[g_value] TEXT);
CREATE INDEX idx_se_re ON search_eng (re_value);
CREATE INDEX idx_se_gv ON search_eng (g_value);
CREATE VIRTUAL TABLE search_eng_fts USING fts3(id, entry_id, re_value, ke_value, g_value);`
Run Code Online (Sandbox Code Playgroud)
我不知道如何使用新创建的FTS表.所以我的问题是如何使用该虚拟表进行搜索?你能给我举个例子吗?
我试图在浮动操作按钮的顶部显示textview.在FrameLayout内部,我有1个FAB和1个TextView:
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|start"
android:padding="@dimen/fab_margin">
<android.support.design.widget.FloatingActionButton
android:id="@+id/fabAddSeller"
android:layout_width="70dp"
android:layout_height="70dp"
app:backgroundTint="#3780f4"
android:stateListAnimator="@null"/>
<TextView
android:id="@+id/tvSellRecordCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/sell_record_counter"
android:layout_gravity="top|end"
android:text="12"
android:textColor="#FFFFFF"
android:textSize="10sp" />
</FrameLayout>
Run Code Online (Sandbox Code Playgroud)
根据这个答案,我补充说
机器人:stateListAnimator = "@空"
FAB - 没有区别.我在FAB之后放了TextView - 没有效果.
如何在FloatingActionButton上显示另一个视图?