小编Eno*_*ong的帖子

Android污迹布局

我从来没有见过像这样的东西,我的布局只是在我的设备上涂抹了(运行Android 4.4.2的Infinix Zero X506)然而在模拟器上它显示得很好,我无法弄清楚原因而我没有在这里或谷歌上看过类似的问题.我正在使用Android Studio 2.2 Preview 1下面是一张图片 布局截图

下面是我的布局xml

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:layout_margin="@dimen/activity_horizontal_margin">
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">
    <TextView
        android:text="@string/title"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/textView"
        android:textStyle="bold"/>

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="textCapSentences"
        android:hint="@string/enter_title"
        android:ems="10"
        android:maxLines="2"
        android:id="@+id/edName" />

    <TextView
        android:text="@string/to_do_details"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/textView2"
        android:textStyle="bold"
        android:layout_marginTop="10dp"/>

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="textMultiLine|textCapSentences"
        android:ems="10"
        android:hint="@string/enter_to_do_details"
        android:id="@+id/edDetails" />

    <TextView
        android:text="@string/select_priority"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/textView3"
        android:textStyle="bold"
        android:layout_marginTop="10dp"/>

    <Spinner
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/spPriority"
        />
    <TextView
        android:text="@string/set_time"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/textView6"
        android:textStyle="bold"
        android:layout_marginTop="10dp"/>
    <Button
        android:background="@color/colorAccent"
        android:textStyle="bold"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:id="@+id/btDate"
        />
    <TextView
        android:text="@string/set_date" …
Run Code Online (Sandbox Code Playgroud)

android android-emulator android-layout

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

如何让Kotlin停止向错误的类转换参数(接口)

我最近和Kotlin一直在闲逛,这真是太棒了!

我正在使用Twitter4j库来试用Twitter API的一些东西.我在Kotlin写了这段代码

object Demo {

    private val twitterStream = TwitterStreamFactory().instance
    @JvmStatic
    fun main(args: Array<String>) {

        val listener = object : StatusListener {

            override fun onStallWarning(warning: StallWarning?) {
                println("Got stall warning:" + warning)
            }

            override fun onScrubGeo(userId: Long, upToStatusId: Long) {
                println("Got scrub_geo event userId:$userId upToStatusId:$upToStatusId")
            }

            override fun onStatus(status: Status) {
                println("@" + status.user.screenName + " - " + status.text)
            }

            override fun onDeletionNotice(statusDeletionNotice: StatusDeletionNotice) {
                println("Got a status deletion notice id:" + statusDeletionNotice.statusId)
            }
            override fun onTrackLimitationNotice(numberOfLimitedStatuses: Int) …
Run Code Online (Sandbox Code Playgroud)

java twitter4j kotlin

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