0

私はappceleratorチタンに取り組んでいます。ほぼ同じコードをKitchenSinkにコピーしてテーブルビューを作成した後、デバイス(GalaxyNexusのAndroid4)に表示すると、TableViewがズームアウトされてしまいました。ズームアウトは、フォントと画像が非常に小さいことを意味します。奇妙なことは次のとおりです。1-Androidエミュレーターで正しく表示されます2-Androidデバイスで正しく表示されますがKitchenSinkを使用しています何が問題になる可能性がありますか?その部分のコードは次のとおりです。

    if (Ti.Platform.name == 'android') 
{
    Titanium.UI.currentWindow.backgroundColor = '#4e5c4d';
}
else
{
    Titanium.UI.currentWindow.backgroundColor = '#aebcad';
}

// create table view data object
var data = [

    {title:'Table View (Layout 2)', hasChild:true, test:'../main_windows/profile.js'}
];


// create table view
var tableViewOptions = {
        data:data,
        style:Titanium.UI.iPhone.TableViewStyle.GROUPED,
        headerTitle:'TableView examples and test cases',
        footerTitle:"Wow. That was cool!",
        backgroundColor:'transparent',
        rowBackgroundColor:'white'

    };


var tableview = Titanium.UI.createTableView(tableViewOptions);

// create table view event listener
tableview.addEventListener('click', function(e)
{
    if (e.rowData.test)
    {
        var win = Titanium.UI.createWindow({
            url:e.rowData.test,
            title:e.rowData.title
        });
        Titanium.UI.currentTab.open(win,{animated:true});
    }
});

// add table view to the window
Titanium.UI.currentWindow.add(tableview);
4

2 に答える 2

1

解決済み:

tiapp.xmlファイルを変更して、次の行を追加する必要がありました。

    <supports-screens android:anyDensity="false"/>

android mainfestセクションにあるので、次のようになります。

<android xmlns:android="http://schemas.android.com/apk/res/android">
    <manifest>
            <supports-screens android:anyDensity="false"/>

        </manifest>

</android>
于 2012-04-20T22:19:51.467 に答える
0

グーグルのアドバイスはAndroid1.4以下でのみこれを使用することであるため、注意する必要があります。より良い解決策は、画面サイズに合う画像を作成することです。

http://developer.android.com/guide/topics/manifest/supports-screens-element.html#anyを参照してください

于 2012-05-18T14:56:53.077 に答える